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 add new employee details in an employee_details table with the following details
What is difference between pls_integer and integer?
Why do we need sharding?
What is sql scripting?
What is the primary key?
what is the difference between char and varchar data types? : Sql dba
In a distributed database system, can we execute two queries simultaneously?
What is faster join or subquery?
Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?
Is mariadb nosql?
What are the possible values that can be stored in a boolean data field?
What is the use of <> sql?
What is the command used to fetch first 5 characters of the string?
How to select all records from the table?
Is sql dba a good career? : SQL DBA