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 happens if you lost a data file?

1027


What are the attributes of the cursor?

980


What are the common oracle dba tasks?

1123


What is blob datatype?

1100


How can I see all tables in oracle?

996


How many file formats are supported to export data?

1195


How to check the oracle tns settings?

1032


What is columnar storage what is the advantage?

1035


How do I spool to a csv formatted file using sqlplus?

1006


What is bulk load in oracle?

1051


What are the various oracle database objects?

1128


22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100

1998


What are the oracle differences between nvl and coalesce

1129


What is Segment Advisor in Oracle?

1088


what is difference between sql plus and sql*plus? (not sql and sql plus).

3874