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 / biswaranjan
this works good for the query
select (select sum(a.amount) from one a where
a.account='d')-(select sum(b.amount) from one b where
b.account='c') from dual;
Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
What is the best free sql database?
What is the difference between local and global temporary table?
How do you take the union of two tables in sql?
What is benefit of creating memory optimized table?
What are two statement types in sql?
how to drop an existing view in mysql? : Sql dba
What are records give examples?
What are all the different types of indexes?
Mention what does plvtab enables you to do when you showthe contents of pl/sql tables?
what are the nonstandard string types? : Sql dba
what is a constraint? Tell me about its various levels. : Sql dba
How do I view a table in sql?
What is sql and how does it work?
what happens if you no create privilege in a database? : Sql dba
What are expressions?