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 are aggregate and scalar functions?
Is mariadb a nosql database?
Can we rename a column in the output of sql query?
Explain some predefined exceptions.
How to look at the current sql*plus system settings?
How to check if a column is nullable before setting to nullable?
what is the difference between char_length and length? : Sql dba
What is the use of non clustered index?
What are triggers and its types?
What is the difference between union and union all command?
Do prepared statements prevent sql injection?
What is a dirty read sql?
Define SQL and state the differences between SQL and other conventional programming Languages?
How can you load multi line records? : aql loader
what are null values? : Sql dba