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 tns entry?
How to increment dates by 1 in oracle?
Assuming today is Monday, how would you use the DBMS_JOB package to schedule the execution of a given procedure owned by SCOTT to start Wednesday at 9AM and to run subsequently every other day at 2AM.
How to create additional tablespaces for an new database?
22. Display the order number, number of lines in the order, total number of items and total value for all orders that have a total value greater than $100
HI ALL, CAN ANYONE TELL ME THE DIFFERENCES BETWEEN SQL CLUSTURS,MSQL CLUSTERS,ORACLE CLUSTERS.......THANKS IN ADVANCE
How do I use unicode codesets with the weblogic jdriver for oracle driver?
when we are importing items in inventory, showing errors, Oracle support suggested us for running scripts & also suggested if we run scripts, iprocurement applicaation if is there it will show shared and if we go in future for iprocurement, it wont work. So kinldy suggest any functional solution.
query optmization techniques and quwry analyser+projects+ppts
How to install oracle database 10g xe?
What are the oracle built-in data types?
What is rowid and rownum in oracle?
What is the exact use of Collections?
How would you begin to troubleshoot an ORA-3113 error?
How to use existing values in update statements using oracle?