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
Why do you partition data?
When can we use the where clause and the having clause?
Is sql port 1433 encrypted?
What problem one might face while writing log information to a data-base table in pl/sql?
What is a column in a table?
What is a database event trigger?
what happens if null values are involved in expressions? : Sql dba
what is an extent ? : Sql dba
Which table is left in join?
how to create a new view in mysql? : Sql dba
How will you distinguish a global variable with a local variable in pl/sql?
What is the maximum number of columns in sql table?
How can you save or place your msg in a table?
who introduced sql?
What are the operators used in select statements?