in account table
account type amount
ac1 credit 300
ac2 debit 5000
ac3 credit 3000
ac1 debit 4000
ac3 debit 2000
ac2 credit 4000
write a query how to get sum of credit & sum of debit
Answer Posted / vijay patil
-----------table lavel credit debit
select
sum(case when type=credit then isnull(amount,0)end)sum_credit,
sum(case when type=debit then isnull(amount,0) end)sum_debit
from account_table;
OR -----------table lavel credit debit
select type,sum(amount)amt
from account_table
group by type;
OR (at accont lavel credit debit)
select account,type,sum(amount)amt
from account_table
group by account,type;
Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
How to update values in a table in oracle?
What is truncate oracle?
What is the difference between online and offline backups?
Difference between hot backup vs. Cold backup?
Where are the settings stored for each instance in oracle?
What privilege is needed for a user to delete rows from tables in another schema?
How do I spool in oracle?
State and explain about oracle instance?
What privilege is needed for a user to connect to oracle server?
What do you understand by database schema and what does it hold?
What is the order of defining local variables and sub procedures/functions?
How to write an inner join with the where clause in oracle?
Explain what are the different type of segments?
Explain the difference between replace() and translate() functions in oracle?
hi friends i completed b.com 2004.i have 3y accounting exp. in manufacturing company.now i have completed oracle finance.pls suggest me how will get job in oracle.can i get job in oracle.