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...

acname actype amount
ac1 credit 300
ac2 credit 4000
ac1 debit 4000
ac2 debit 455
ac1 credit 500
how to get sum of credit and sum of debit for each account

Answer Posted / terence

select
acname,
sum(decode(actype,'credit',amount,0)) Credit,
sum(decode(actype,'debit',amount,0)) Debit
from account_table
group by acname

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is clustered table in Oracle?

1262


How do I find the database name in oracle?

1090


What are nested tables?

1227


How to open and close an explicit cursor in oracle?

1101


What is query image?

1023


Why packages are used in oracle?

1122


What happens internally when the user types userID/password@string in SQL PLUS Thanks-Bhaskar

4688


What are joins, explain all types of joins?

2366


How to delete a user account in oracle?

1025


Can you create a synonym without having a table?

1095


What is PL/SQL ?

2220


How many categories of data types?

1043


What is a view and how is it different from a table?

1137


What is control file used for?

1306


What is a trigger oracle?

1141