Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is aggregate function in sql?

1041


What is trigger with example?

1104


How to get help at the sql prompt?

1118


How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?

1109


What is Materialized View? In What Scenario we Use Materialized View?

9522


What is sql analyzer?

1026


What are its different types of dbms?

1008


What is the difference between truncate and drop statements?

1190


Can triggers stop a dml statement from executing on a table?

1101


what is the command used to fetch first 5 characters of the string? : Sql dba

1639


What is row_number () in sql?

985


What is difference between db2 and sql?

1005


how to get @@error and @@rowcount at the same time? : Sql dba

1028


What is sql resultset?

991


What is full form of rtm?

1008