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

How are sql commands classified?

1143


what is a table in a database ? : Sql dba

1090


Is null operator in sql?

1092


What are the disadvantages of not performing database normalization?

1216


Is trigger a stored procedure?

984


what is a relationship and what are they? : Sql dba

1165


What is clause in sql?

1178


what is the use of friend function? : Sql dba

1061


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

1146


When to use inner join and left join?

1019


what are the differences between require and include, include_once and require_once? : Sql dba

1069


Explain how exception handling is done in advance pl/sql?

1046


What is sql injection owasp?

1116


Explain normalization and what are the advantages of it?

1000


Is it possible to update views?

1006