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 / umesh naik
select a.amt1 c_sum ,b.amt2 d_sum
, a.amt1 - b.amt2 cd_diffrence
from
(select sum(amount) amt1 from one_table where account='c')
a,
(select sum(amount) amt2 from one_table where account='c') b
select (select sum(a.amount) from one a where
a.account='d')-(select sum(b.amount) from one b where
b.account='c') from dual;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How would you reference column values before and after you have inserted and deleted triggers?
What is native sql query?
What normalization means?
What are the 3 types of behavioral triggers?
Is sql an operating system?
What is a sql*loader control file?
Name the operator which is used in the query for pattern matching?
What is pl sql architecture?
What is a recursive join sql?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
Explain raise_application_error.
What's the difference between a primary key and a clustered index?
How do I kill a query in postgresql?
What is a heap in sql?
What are sql injection vulnerabilities?