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

Is sql dba a good career? : SQL DBA

529


What are the operators used in select statements?

574


What is use of trigger?

510


What is sql and its types?

625


What are the indexing methods?

571






how to include numeric values in sql statements? : Sql dba

557


what is query cache in mysql? : Sql dba

575


How do I remove sql plus from windows 10?

566


What is the use of sqldataadapter?

532


how to create a new table in mysql? : Sql dba

546


What is sql exception?

515


What is nvarchar max in sql?

578


What is Difference Between Unique and Primary Key Constraints?

604


What are the sql aggregate functions?

604


What is the purpose of the partition table?

540