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

select
tab1.sales_count,tab1.t_sales_amt ,tab2.sales_count_A,tab2.t
_sales_amt_A
From
(select sum(sales) sales_count,sum(sales_amount)
t_sales_amt from sales)tab1,
(select sum(sales) sales_count_A,sum(sales_amount)
t_sales_amt_A from sales where prod='A' group by prod)tab2

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pl/sql cursors?

1101


Is nosql faster than sql?

1074


Can cursors be part of a trigger body?

1693


How do you create a unique index?

1092


What is trigger in pl sql with examples?

1082


how to enter binary numbers in sql statements? : Sql dba

1011


What is natural join in sql?

1044


what is schema? : Sql dba

1113


what is the difference between myisam static and myisam dynamic? : Sql dba

1114


How to test for null values?

1098


What is trigger in sql? Explain

1044


What is error ora-01000: maximum open cursors exceeded

1210


how to use regular expression in pattern match conditions? : Sql dba

1089


What is a recursive stored procedure?

1253


how tsql statements can be written and submitted to the database engine? : Transact sql

1037