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


Please Help Members By Posting Answers For Below Questions

What is db2 purescale?

544


How do I connect my db2 database to ibm?

600


What is universal database?

617


What is the use of db2 optimizer?

606


What is access path in db2?

562






Explain packages.

659


What are the different types of base tables?

583


What is the meaning concurrency in the db2 database?

630


What is the difference between plan and package in db2?

568


what are bind concepts in db2 cobol?

649


How do I import data from excel to db2?

608


Why do we bind in db2?

630


What is the maximum number of columns in a db2 table?

722


What is dclgen in db2?

674


Before you give the explain statement, what are the prerogatives?

579