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.

Answer Posted / ankur maheshwari

select abs(sum(c1.amounts)-sum(d1.amounts)) 'Amount
difference' from account c1, account d1 where
c1.accounts='c' and d1.accounts='d'

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a sql schema used for?

546


What is package in pl sql?

579


What is the usage of sql functions?

548


Is vs as in pl sql?

494


What is sql and also describe types of sql statements?

567






What are the sql versions?

522


What is the difference between partition and index?

485


How does stored procedure reduce network traffic?

550


Explain mutating table error.

649


What is trigger in sql and its types?

538


What are the sql commands?

613


How to get unique records from a table?

525


What are the topics in pl sql?

526


Does sqlite need a server?

543


What is trigger in pl sql with examples?

525