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 / ankur maheshwari
select abs(sum(c1.amounts)-sum(d1.amounts)) 'Amount
difference' from account c1, account d1 where
c1.accounts='c' and d1.accounts='d'
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
What is difference between joins and union?
What is sql entity?
What is varchar sql?
What is using in sql?
What is the difference between local variables and global variables?
Which column of the user triggers data dictionary view displays the database event that will fire the trigger?
What does select * from mean in sql?
What is sql*loader?
mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql
What is full join?
What will you get by the cursor attribute sql%notfound?
How do you define a foreign key?
What is procedure and function in sql?
How many sql databases can you have on one server?
What is a primary key called that is made up of more than one field?