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 |
How and when does the db2 enforces the unique key?
What is the purpose of the DSNC transaction ?
What DB2 Catalog column tell you when an index needs table reorganized ?
if any of the column names is provided wrong, where do you get the error(during precompilation or during Bind)
Suppose pgm A calling Pgm B .Pgm B has some Db2 program. at the time of compilation should plan and package will be created for both A and B or only B? What is the concept?
when does the SQL statement gets executed when you use cursor in the application programming ?
How to solve S0C7 abend with out using DISPlay in 10 mins?
what is datacom db?
What are common abends
If I have 5 Queries in a DB2 Cobol program , while precompiling how many DBRMs will get created and How many Plans and Packages will get created while Bind Process?
What is error -818 in db2. where can you find the timestamp of the DBRM and the source code.( precompile puts the timestamp on dbrm and source code correct?)
Explain db2.