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 / apurba

SELECT SUM(C)-SUM(D) FROM TABLE_NAME;

Is This Answer Correct ?    8 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does sql full backup truncate logs?

533


what is the difference between delete and truncate commands? : Sql dba

539


what is a composite primary key ? : Sql dba

583


How to get unique records from a table?

525


What are the disadvantages of file system?

619






Explain the difference between cursor declared in procedures and cursors declared in the package specification?

579


What are % type and % rowtype?

578


What is sql exception?

520


how to enter characters as hex numbers? : Sql dba

574


What is meant by <> in sql?

511


How can I get the number of records affected by a stored procedure?

581


What is right join sql?

541


How many primary keys can a table have?

534


What will you get by the cursor attribute sql%notfound?

595


What do you understand by pl/sql packages?

573