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 Select second Maximum salary in a Table ?
What is Index and different types of Indexes?
How would you design a database for an e-commerce website?
How do I connect to oracle?
How do we get field detail of a table?
What happens if the update subquery returns multiple rows?
What is the sql query to concatenate column values from multiple rows in oracle?
I have a table like this Table Name:Products Productid Price 1 10 1 10 2 20 3 30 3 30 But i want to output like this. productid price 2 20. please replay me.
What is blob datatype?
How to manage transaction isolation level?
Database is hung. Old and new user connections alike hang on impact. What do you do? Your SYS SQLPLUS session IS able to connect.
Explain a segment?