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 can deadlocks be resolved?
List out the three types of page locks that can be held.
What are the different types of base tables?
What is bind plan?
How many databases can be created inside an instance in db2 ?
If the cursor is kept open followed the issuing of commit, what is the procedure to leave the cursor that way?
What does db2 stand for?
What is deadlock in db2?
What is innodb buffer pool?
What is a page in db2?
Which isolation level provides maximum concurrency?
I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.
What is scrollable cursor in db2?
How to execute stored procedure in db2 command editor?
How to rename a table in DB2 ?