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
Answer Posted / 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 |
Post New Answer View All Answers
How to view db2 table structure?
What is the difference between drop table and delete table?
What is dbrm? When it will be created?
What is runstats and reorg in db2?
Explain about rct.
What is the role of schema in the db2 database?
Explain db2.
List down the types of triggers in the db2 database?
What is the default page size of buffer pools?
Is db2 relational database?
What is the difference between nvl and coalesce?
How can you find out the # of rows updated after an update statement?
What is cobol db2?
What is with ur in db2?
Who uses db2?