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 maximum number of columns in sql table?
What is function and procedure in pl sql?
What is the difference between a database and a relational database?
What port does sql server use?
How do I create an index in word?
What is AUTH_ID and AUTH_USER in pl/sql ?
What is %rowtype in pl sql?
How do I add a database to sql?
How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?
Can one improve the performance of sql*loader? : aql loader
what are the t string functions available in tsql? : Transact sql
What is a data manipulation language?
What is trigger explain it?
Is primary key a clustered index?
what is the difference between a having clause and a where clause? : Sql dba