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
What is the physical storage length of date data type?
What db2 400?
Can we delete records from view?
Define check constraint.
What is universal database?
Why do chiropractors use drop table?
How does cobol compile db2 program?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
Explain the function done by data manager?
What is the physical storage length of the data types: date, time, timestamp in the db2 database?
Before you give the explain statement, what are the prerogatives?
What is runstats db2?
What is check constraint in db2?
In an sql table that is embedded, what is the procedure to retrieve rows that are part of a db2 table?
If I have a view which is a join of two or more tables, can this view be updateable?