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 / welcomeashwin

SELECT
T1.SALES_COUNT, T1.T_SALES_AMT,
T2.SALES_COUNT_A, T2.T_SALES_AMT_A
FROM
(SELECT SUM(SALES) SALES_COUNT,
SUM(SALES_AMOUNT) T_SALES_AMT
FROM SALES)T1,
(SELECT SUM(SALES) SALES_COUNT_A,
SUM(SALES_AMOUNT) T_SALES_AMT_A
FROM SALES
WHERE PROD='A' GROUP BY PROD)T2

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the size of partition table?

1088


What are all the ddl commands?

1242


What's the procedure?

982


What are the two different parts of the pl/sql packages?

1139


What is an exception in PL/SQL? What are the two types of exceptions?

1395


What is output spooling in sql*plus?

1089


explain about mysql and its features. : Sql dba

1052


What is pl/sql language case sensitive?

1181


What are the types of sql commands?

1157


What is Difference Between Unique and Primary Key Constraints?

1153


how to start mysql server? : Sql dba

1237


How delete a row in sql?

1041


What is the starting oracle error number?

1096


What is group function in sql?

1067


What are all ddl commands?

1127