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
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / amit kumar
select sum(amount) amt , acname, actype from table group by
acname , actype
Is This Answer Correct ? | 6 Yes | 2 No |
What is ASM (Automatic Storage Management) in Oracle?
How to delete a column in an existing table in oracle?
Explain the difference between sap and oracle?
what is query and types of query
What is set operator oracle?
What is null value in oracle?
How do I recompile a procedure in oracle?
Why does oracle 9i treat an empty string as null?
what is the bitmap index?
What are the common oracle dba tasks?
How to see the table columns used in an index?
How to export data with a field delimiter?