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 display row numbers with the records?
How to enter a new row into a table interactively?
Difference between hot backup vs. Cold backup?
Explain what are the different type of segments?
What is recovery manager in Oracle?
Can multiple cursors being opened at the same time?
5. Display full details for the creditor/s who has received the single largest payment. Do not use a table join or set operator anywhere in your query.
What are the types of trigger in oracle?
What is the difference between SQL, DDL, and DML?
7 Answers BeBo Technologies, Wipro,
Can any one explain me when i execute below query.. select months_between('07-JUL-12','10-FEB-12') from dual; Out put:- 4.90322581 How oracle calculate?
What happens to the current transaction if a ddl statement is executed?
What is the difference between formal parameters and actual parameters?