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

How to disable a trigger name update_salary?

1197


Mention what does plv msg allows you to do?

1053


Is a view faster than a stored procedure?

903


Can we insert in sql function?

1027


What is difference between mysql and postgresql?

1046


How to select all records from the table?

1069


what is oltp (online transaction processing)? : Sql dba

1016


What are the different schemas objects that can be created using pl/sql?

969


How to load data with sql*loader?

1000


How is pl sql different from sql?

1015


Why do we use %rowtype & %type in plsql?

994


how many values can the set function of mysql take? : Sql dba

935


What is the difference between distinct and unique in sql?

876


What are the ways on commenting in a pl/sql code?

1053


What are the types of dbms?

922