Source is Sales Table:
Sno Prod Sales Sales_Amount
1 A 10 2000
2 A 20 1000
3 C 10 3000
4 D 30 4000
5 A 20 1000
Target :
Sales_Count T_Sales_Amt Sales_Count(A) T_Sales_Amt(A)
90 11000 50 4000
In single query, pls tell me.
Answer Posted / satish
select sum(prod),
sum(sales_amount),
sum(decode(prod,'A',sales)),
sum(decode(prod,'A',sales_amount))
from sales
Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the difference between alter trigger and drop trigger statements?
What is the current version of postgresql?
How many parts of a pl sql block are optional?
Is it possible to create the following trigger: before or after update trigger for each row?
What are aggregate and scalar functions?
When do we use triggers?
List the various privileges that a user can grant to another user?
how to return query output in html format? : Sql dba
Is primary key clustered or nonclustered?
what is bcp? When is it used?
what is 'mysqld'? : Sql dba
Can we perform dml on view?
What are sql commands?
What is the difference between mdf and ndf files?
What sql database should I use?