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 / biswaranjan
this works good for the query
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 ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is sql and explain its components?
Does sql support programming?
What are inbuilt functions in sql?
What is the difference between function, procedure and package in pl/sql?
what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?
Explain the difference between 'between' & 'and' operators in sql
Can you sum a count in sql?
how to convert numeric values to character strings? : Sql dba
What are the types of records?
How can you get sql*loader to commit only at the end of the load file? : aql loader
What are the types of keys?
What are the different datatypes available in PL/SQL?
Enlist some predefined exceptions?
How to get list of all tables from a database?
what is timestamp in mysql? : Sql dba