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 |
How to pass a parameter to a cursor in oracle?
What is the exact use of Collections?
If a table column has is UNIQUE and has NOT NULL, is it equivalent to a PRIMARY KEY column?
How to drop an existing view in oracle?
What are group functions in oracle?
Can you assign multiple query result rows to a variable?
Can an Integrity Constraint be enforced on a table if some existing table data does not satisfy the constraint ?
What are the different types of modules in oracle forms?
What is rowid and rownum in oracle?
What are the differences between lov and list item?
What is a trigger oracle?
what is kernel?