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
How is indexing done in search engines?
Can a view be mutating? If yes, then how?
What is the use of nvl function?
What are the three pl sql block types?
What do we need to check in database testing?
How we can update the view?
What is sap sql?
What are few of the schema objects that are created using PL/SQL?
What are tuples in sql?
How many primary keys can a table have?
Why do we use set serveroutput on?
how to get @@error and @@rowcount at the same time? : Sql dba
Do prepared statements prevent sql injection?
How do we use distinct statement? What is its use?
how to analyze tables with 'mysqlcheck'? : Sql dba