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 Declaration Generator(DCLGEN)?
What is cursor in dbms?
What is a synonym? How is it used?
What is blu acceleration in db2?
what is dynamic cursor?gives syntax for this?
How to find primary key of a table in db2?
What is reorg in DB2
How we create a tables in db2,what is the process/syntax to create a table with example plz?
What are the various locking levels available?
I have a table(product),It contain fields(productname,cost). I want to retrieve the product name ,which cost is second maximum in the table?
How Plan is created while executing the query using SPUFI?
What is host variable in db2 cobol?