I have a table name Table1 which contain columns Cust_no,
car_model, country, salesamt. The records are 101, Fiat,
India, 12345
2nd record is 102, Tata, USA, 98743 3rd record is 101,
indica, India, 65342 4th record is 103, Toyota, UK, 64522
5th record is 103, Maruti, USA, 98632 and so on.....
Now my question is write sql query which will give me
detail about the sum of sales amount in perticular country
Answers were Sorted based on User's Feedback
Answer / satty
select country,sum(salesamt) from table1 groupby country;
but if its primary key is cust-no, then it will show error
-803 try to insert duplicates in primary key value.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / raghu
select country,sum(salesamt) from table1 where country = ind;
| Is This Answer Correct ? | 0 Yes | 1 No |
What is cursor with hold option in db2?
What is package in cobol db2?
What is precompiler in db2?
What is the difference between oracle and db2?
Is Cursor exicutable ?
Which command is used to remove all rows from a table?
What is multi row fetch in db2?
What is a DB2 plan?
What is the difference between IN subselects and EXISTS subselect?
What is meant by repeatable read?
what is parm utility
How do you leave the cursor open after issuing a COMMIT? (for DB2 2.3 or above only)