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 / ravi
select sum(sales) sales_count,sum(sales_amount) t_sales_amount
,(select sum(sales_count) sales_count(A),sum(sales_amount)
t_sales_amt(A) from sales_table group by prod) from sales_table;
| Is This Answer Correct ? | 0 Yes | 4 No |
Post New Answer View All Answers
How to disable a trigger name update_salary?
Mention what does plv msg allows you to do?
Is a view faster than a stored procedure?
Can we insert in sql function?
What is difference between mysql and postgresql?
How to select all records from the table?
what is oltp (online transaction processing)? : Sql dba
What are the different schemas objects that can be created using pl/sql?
How to load data with sql*loader?
How is pl sql different from sql?
Why do we use %rowtype & %type in plsql?
how many values can the set function of mysql take? : Sql dba
What is the difference between distinct and unique in sql?
What are the ways on commenting in a pl/sql code?
What are the types of dbms?