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

SELECT ABS(SUM(DECODE(ACCOUNTS,'C',AMOUNTS))-SUM(DECODE
(ACCOUNTS,'D',AMOUNTS))) FROM TEMP

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to get list of all tables from a database?

842


What is the difference between microsoft access and sql?

725


What is constant in pl sql?

708


What are the dml statements?

854


what is the command line end user interface - mysql? : Sql dba

695






describe transaction-safe table types in mysql : sql dba

701


What is the difference between partitioning and sharding?

730


What is data control language (dcl)?

790


What is oracle and pl sql?

829


What is meant by temporal data?

707


how to escape special characters in sql statements? : Sql dba

713


What is before trigger?

735


How do I view a table in sql?

720


What is a pdo connection?

685


What is rank function in sql?

722