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
What happens if you lost a data file?
What are the attributes of the cursor?
What are the common oracle dba tasks?
What is blob datatype?
How can I see all tables in oracle?
How many file formats are supported to export data?
How to check the oracle tns settings?
What is columnar storage what is the advantage?
How do I spool to a csv formatted file using sqlplus?
What is bulk load in oracle?
What are the various oracle database objects?
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
What are the oracle differences between nvl and coalesce
What is Segment Advisor in Oracle?
what is difference between sql plus and sql*plus? (not sql and sql plus).