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 / bunty
Hi,
I dont know if this is a intended way for which interviewer
has asked, but it will definitely give an answer,
select (select sum(value) from test_tab where parent='D')-
(select sum(value) from test_tab where parent='C')
difference from dual;
Cheers,
Bunty
| Is This Answer Correct ? | 13 Yes | 2 No |
Post New Answer View All Answers
How to revise and re-run the last sql command?
What are the different types of dbms?
Is sql pronounced sequel or sql?
when MSQL8.0 is in market
How to combine two stored procedures in sql?
what is self-join? : Sql dba
What is difference between cursor and trigger?
how to select unique records from a table? : Sql dba
What is trigger in sql and its types?
What are stored procedures in mysql?
Can we use threading in pl/sql?
How can you fetch common records from two tables?
How many types of keys are there in sql?
how can we optimize or increase the speed of a mysql select query? : Sql dba
Is sql a oracle?