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 / sandeep

I hope this will be helpful.

SELECT sum(Account) as "Account Sum", sum(Amount) as "Amount
Sum", sum(Amount)-sum(Account) as "Difference" FROM account

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does truncate require commit?

547


How do you write a subquery?

525


What is partition by in sql?

574


What is the main reason behind using an index?

560


explain advantages of innodb over myisam. : Sql dba

648






Why is stored procedure faster than query?

496


What is sqlcommand?

558


What are tables and fields in the database?

556


How do you truncate?

507


What is the need of merge statement?

557


Is it possible to create startup or shutdown trigger for on-schema?

589


How to create a menu in sqlplus or pl/sql?

613


What is sql exception?

520


What are the possible values for the boolean data field?

527


What do you mean by dbms? What are its different types?

557