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 / vijay sinha
select (select sum(amount) from table_name where account = 'C') - (select sum(amount) from table_name where account = 'D')
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is sql keyword?
Why do we use procedures in pl sql?
What packages(if any) has oracle provided for use by developers?
What is sql*loader and what is it used for? : aql loader
Explain isolation levels. : Transact sql
What is a mutating table and a constraining table?
what are the authentication modes in sql server? How can it be changed? : Sql dba
What is dml with example?
what are the advantages of using stored procedures? : Sql dba
what is union, minus and interact commands? : Sql dba
Which is better stored procedure or query?
Does asenumerable execute the query?
Can you inner join the same table?
What is a subquery in sql?
What is optimistic concurrency control? : Transact sql