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

what is the difference between char_length and length? : Sql dba

569


Is sql similar to python?

535


How much does sql certification cost?

543


how to get help information from the server? : Sql dba

526


what are the disadvantages of mysql? : Sql dba

570






Is crud a cuss word?

544


What is output spooling in sql*plus?

549


What do you mean by table in sql?

524


What is the use of partition by in sql?

514


Difference between truncate, delete and drop commands?

557


What is foreign key and example?

514


explain advantages of myisam over innodb? : Sql dba

595


Is full outer join same as cross join?

501


what are null values? : Sql dba

542


How are sql commands classified?

589