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

Explain the uses of a database trigger?

575


How to add new employee details in an employee_details table with the following details

653


What are the two parts of design view?

585


What is mutating error?

511


what is an alias command? : Sql dba

552






What is the difference between execution of triggers and stored procedures?

556


Can we create index on primary key?

524


What are sql ddl commands?

552


What is join view in sql?

515


Can we insert data into view?

527


list out some tools through which we can draw e-r diagrams for mysql. : Sql dba

513


What is difference between rank () row_number () and dense_rank () in sql?

583


Why do we use sql constraints? Which constraints we can use while creating database in sql?

551


What do you mean by stored procedures? How do we use it?

529


Can a foreign key be a duplicate?

510