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 / anuj shukla

Hi all,
question simply ask for the total of both the columns and
their difference, all in one 'select' statement.

select sum(c)"Sum of C",sum(d)"Sum Of
D",abs(sum(c)-sum(d))"Difference" from accountA

Is This Answer Correct ?    4 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between clustered and non-clustered indexes?

590


Can we commit inside a trigger?

537


What is sqlcontext?

543


Why should I use postgresql?

553


How many disk partitions should I have?

538






Why we use triggers in mysql?

550


Which is better cte or subquery?

531


what are the differences between require and include, include_once and require_once? : Sql dba

517


What are the 3 types of behavioral triggers?

649


how to get a list of all tables in a database? : Sql dba

502


What is compound trigger?

549


How do I access sql anywhere database?

489


What is native sql query?

538


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

582


Which is faster truncate or drop?

548