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 primary key and foreign key with example?

685


Can we insert data into view?

680


Explain the purpose of %type and %rowtype data types?

663


Does sql use python?

756


give the syntax of grant and revoke commands? : Sql dba

803






Can a procedure in a package be overloaded?

754


What are different types of keys?

737


Mention what is the use of function "module procedure" in pl/sql?

784


Is drop table faster than truncate?

740


What is a table partition?

789


What is string data type in sql?

724


Define join and name different types of joins?

712


How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?

814


Will truncate release space?

678


What is exit statement?

744