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 bitemporal narrowing?
what are the different type of normalization? : Sql dba
How do you optimize a stored procedure query?
how to drop an existing view in mysql? : Sql dba
how tsql statements can be written and submitted to the database engine? : Transact sql
Does sqlite need a server?
How many types of keys are there in sql?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
why does the selected column have to be in the group by clause or part of an aggregate function? : Sql dba
Write the command to remove all players named sachin from the players table.
- Types of triggers - View - Dcl - Procedures, packages, functions - Metasolve - Can use Dcl in triggers - package case study - Cursor and its types - triggers schedule - Wrap - Why we are using fetch and for in cursor. difference?
How to check if a column is nullable before setting to nullable?
Explain autonomous transaction.
How can get second highest salary in sql?
How do I remove all records from a table?