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 to check the server version in oracle?
What are the different types of database objects?
 How to use an oracle sequence generator in a mapping?
What is a database table in oracle?
How to define a data field as not null?
How different is ms access and oracle?
What are the different types of record groups in oracle? Explain each of them
How much memory your 10g xe server is using?
What is a named program unit?
What is index in Oracle?
What is user managed backup in Oracle?
What are the oracle differences between nvl and coalesce
What is an anonymous block?
What is the difference between Delete, Truncate and Drop in Oracle?
Is oracle a programming language?