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 / anuj shukla
Hi all,
question simply ask for the total of both the columns and
their difference, all in one 'select' statement.
select sum(c)"Sum of C",sum(d)"Sum Of
D",abs(sum(c)-sum(d))"Difference" from accountA
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
How to set up sql*plus output format in oracle?
How do you bind variables in pl sql?
How to get help at the sql prompt?
Can a table contain multiple foreign key’s?
What are different types of indexes?
How to read/write files from pl/sql?
Can we commit inside a trigger?
How does sql developer connect to oracle database?
Why do we create views in sql?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
What is primary key in db?
what are the different index configurations a table can have? : Sql dba
Explain what is a view?
How does postgresql compare to mysql?
What is number function in sql?