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 is sql and explain its components?

1119


Does sql support programming?

1116


What are inbuilt functions in sql?

1109


What is the difference between function, procedure and package in pl/sql?

1355


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2553


Explain the difference between 'between' & 'and' operators in sql

1046


Can you sum a count in sql?

1061


how to convert numeric values to character strings? : Sql dba

1162


What are the types of records?

1038


How can you get sql*loader to commit only at the end of the load file? : aql loader

1062


What are the types of keys?

1067


What are the different datatypes available in PL/SQL?

1150


Enlist some predefined exceptions?

1115


How to get list of all tables from a database?

1212


what is timestamp in mysql? : Sql dba

1133