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 can I use instead of union in sql?
How do I truncate a word?
Difference between global and parameter variables?
What is the difference between view and stored procedure?
Can you select everything, but 1 or 2 fields, without writer's cramp?
how to delete an existing column in a table? : Sql dba
Explain raise_application_error.
What are the different operators available in sql?
Which command is used to call a stored procedure?
What is case function?
What are the string functions in sql?
What do you mean by stored procedures?
How many sql statements are used? Define them.
what is the difference between truncate and delete statement? : Transact sql
How many row comparison operators are used while working with a subquery?