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 are the sql versions?
What is case function?
What is the use of double ampersand (&&) in sql queries? Give an example
what is the difference between inner and outer join? Explain with example. : Sql dba
what is sp_pkeys? : Transact sql
How do you drop a trigger?
Why is pl sql used?
what are the authentication modes in sql server? : Sql dba
What are the different types of functions in sql?
what happens if null values are involved in expressions? : Sql dba
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
What is the difference between inner join and outer join?
Can we use ddl commands in pl sql?
Can you load data into multiple tables at once? : aql loader
What are the disadvantages of file system?