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
What is sql and its types?
What is difference between stored procedure and trigger?
What is a design view?
What are the 3 modes of parameter?
What is sql and db2?
What is the use of primary key?
Does truncate require commit?
Can we insert data into view?
Does mysql_real_escape_string prevent sql injection?
Is drop table faster than truncate?
What is 19 null in sql?
how to check myisam tables for errors? : Sql dba
Does a primary key have to be a number?
write an sql query to find names of employee start with 'a'? : Sql dba
what is a unique key ? : Sql dba