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
Determine if oracle date is on a weekend?
Is left join same as join?
What's the difference between a primary key and a clustered index?
How do you optimize a stored procedure query?
How do I edit a stored procedure?
What is string data type in sql?
What is on delete restrict?
Is mariadb a nosql database?
What trigger means?
What is pl sql block structure?
Explain 3 basic parts of a trigger.
how to present a past time in hours, minutes and seconds? : Sql dba
What is the difference between sql, mysql and sql server?
Explain what is rdbms?
What is difference between hql and native sql?