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
What are the different types of joins in sql?
What is substitution variable in pl sql?
What is sqlexception in java?
What program will open a mdb file?
Why we use join in sql?
tell us something about heap tables. : Sql dba
Does normalization improve performance?
What is compilation error in pl sql?
explain what is mysql? : Sql dba
Can we create index on primary key?
How to download oracle sql developer?
Which join condition can be specified using on clause?
What is index example?
how to check myisam tables for errors? : Sql dba
What is sharding in sql?