i have one table with accounts and amounts as
colums.accounts with columns c and d. and amounts with
values 1000,2000,3000 for c and 4000,5000,8000 for d.i need
to find the sum of these accounts c and d individually
and find the differences between their sum using one select
statement.

Answers were Sorted based on User's Feedback



i have one table with accounts and amounts as colums.accounts with columns c and d. and amounts wit..

Answer / sandeep

I hope this will be helpful.

SELECT sum(Account) as "Account Sum", sum(Amount) as "Amount
Sum", sum(Amount)-sum(Account) as "Difference" FROM account

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More SQL PLSQL Interview Questions

How delete all data from table in sql?

0 Answers  


How do I edit a stored procedure?

0 Answers  


What is cursor explain with example?

0 Answers  


How do you create an update query?

0 Answers  


what happens if you no create privilege in a database? : Sql dba

0 Answers  






Can a select statement fire a trigger?

0 Answers  


trans_id trans_date trans_amt debit_credit_indicator 001 01-JAN-13 1099 cr 001 12-JAN-13 500 db 002 24-FEB-13 400 db 002 23-MAR-13 345 cr 001 18-APR-13 800 cr 002 15-MAR-13 600 db 001 12-FEB-13 200 cr i want like this output trans_id trans_date trans_amt debit_credit_indicator 001 JAN 1599 cr no.of trans 2 i want trans_id and trans_date like 'JAN' or 'FEB' etc, trans_amt i want all credit amount - debit amount per each trans_id. and debit_credit_indicator and no.of transactions in a month.

1 Answers   Oracle,


How do I run a script in sql developer?

0 Answers  


What is rowid in sql?

0 Answers  


What are tuples in sql?

0 Answers  


How many types of normalization are there?

0 Answers  


What is a recursive stored procedure?

0 Answers  


Categories