Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What can I use instead of union in sql?

902


How do I truncate a word?

996


Difference between global and parameter variables?

1905


What is the difference between view and stored procedure?

909


Can you select everything, but 1 or 2 fields, without writer's cramp?

930


how to delete an existing column in a table? : Sql dba

951


Explain raise_application_error.

1041


What are the different operators available in sql?

959


Which command is used to call a stored procedure?

949


What is case function?

987


What are the string functions in sql?

922


What do you mean by stored procedures?

950


How many sql statements are used? Define them.

981


what is the difference between truncate and delete statement? : Transact sql

1015


How many row comparison operators are used while working with a subquery?

974