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

Does view store data in sql?

532


How many types of primary keys are there?

525


What is online transaction processing (oltp)?

600


Which is better stored procedure or query?

544


what is rdbms? : Sql dba

579






Is it possible to include an insert statement on the same table to which the trigger is assigned?

559


What is query syntax?

519


What are the two types of exceptions in pl/sql?

543


what is the difference between truncate and drop statements? : Sql dba

552


Can a view be mutating? If yes, then how?

572


what is primary key? : Sql dba

510


Is primary key a clustered index?

533


Can we change the table name in sql?

530


Can cursors be part of a trigger body?

1114


What is the difference between join and natural join?

473