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 is the benefit of foreign key?
Which sorts rows in sql?
How to prepare for oracle pl sql certification?
How can you create an empty table from an existing table?
what are the different tables present in mysql? : Sql dba
How to combine two stored procedures in sql?
Why do we need unique key in a table?
Are dml statements autocommit?
what is “go” in t-sql? : Transact sql
What is the difference between pl and sql?
What is microsoft t sql?
How do I partition in sql?
I need a function for a train ticket reservation please answer it thanks in advance
Which sql statement is used to return only different values?
What is sql resultset?