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
How do I use unicode codesets with the weblogic jdriver for oracle driver?
Explain what are the different type of segments?
what is normalisation?what are its uses?
Respected sir, Please send me technical questions related to oracle apps..
What are the differences between char and varchar2 in oracle?
can u send the sql dumps to sivakumarr1987@gmail.com plz help me
What happens if variable names collide with table/column names?
Explain the use of full option in exp command.
How to insert multiple rows with one insert statement in oracle?
What is private procedure oracle?
How to filter out duplications in the returning rows using oracle?
How to synchronize 2 schema's objects?
What is an index associated with a constraint?
what are steps for interface? where is exchange rate defined in which table?
What are the original export and import utilities?