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

select sum(prod),
sum(sales_amount),
sum(decode(prod,'A',sales)),
sum(decode(prod,'A',sales_amount))
from sales

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is there a way to automate sql execution from the command-line, batch job or shell script?

970


What does fetching a cursor do?

1088


What is the difference between microsoft access and sql server?

1059


Does pdo prevent sql injection?

931


what are the different tables present in mysql? : Sql dba

984


How to add a column ‘salary’ to a table employee_details?

1012


How do I install microsoft sql?

1050


What is a sql trace file?

1028


what is self join and what is the requirement of self join? : Sql dba

1145


Which data dictionary views have the information on the triggers that are available in the database?

1236


What is sqlservr exe?

977


Which sql statement is used to return only different values?

1003


Can we insert data in view?

962


How do you update a value in sql?

1043


What are the features of pl sql?

1067