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 |
Which dictionary view(s) would you first look at to understand or get a high-level idea of a given Advanced Replication environment?
Is there any function in oracle similar like group_concat of mysql?
a query to select maxmun 3 salaries of employee table
What are set operators?
Explain oracle 12c new features for developers?
what is the difference between rollback & commit? can a foreign key has null value?
what are stored procedures?
Explain the use of constraints option in exp command.
State all possible different index configurations a table can possibly have?
Query to retrieve record for a many to many relationship ?
How to select oracle sequence from different schema and How to select oracle sequence from different Databases. Explain with example
What is SYSTEM tablespace and When is it Created?