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
Explain the uses of a database trigger?
How to add new employee details in an employee_details table with the following details
What are the two parts of design view?
What is mutating error?
what is an alias command? : Sql dba
What is the difference between execution of triggers and stored procedures?
Can we create index on primary key?
What are sql ddl commands?
What is join view in sql?
Can we insert data into view?
list out some tools through which we can draw e-r diagrams for mysql. : Sql dba
What is difference between rank () row_number () and dense_rank () in sql?
Why do we use sql constraints? Which constraints we can use while creating database in sql?
What do you mean by stored procedures? How do we use it?
Can a foreign key be a duplicate?