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 is query image?
Iam learning oracle developer 2000.. can anyone give me then tutorials sites or PDF related to developer 2000 please send me the details @ mak2786@gmail.com thanks Arun
How to use "in out" parameter properly?
How to create a table in a specific tablespace?
How to update values in a table in oracle?
How to create a stored function in oracle?
How will you write a query to get a 5th rank student from a table student_report?
How to use an explicit cursor without open statements?
How to use windows user to connect to the server?
What is raw datatype?
What are the roles of dba?
Please explain compound trigger in oracle?
How do I call oracle stored procedures that take no parameters?
How to define default values for formal parameters?
What is format trigger?