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 / lalitha

SELECT ABS(SUM(DECODE(ACCOUNTS,'C',AMOUNTS))-SUM(DECODE
(ACCOUNTS,'D',AMOUNTS))) FROM TEMP

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is a tablespace? : Sql dba

1057


What are some emotional triggers?

986


what are the differences between procedure-oriented languages and object-oriented languages? : Sql dba

1052


What do you understand by exception handling in pl/sql?

1036


How to fetch alternate records from a table?

1245


How to assign sql query results to pl sql variables?

1084


What is delimiter in pl sql?

1064


What is the least restrictive isolation level? : Transact sql

1070


What are types of exception?

922


What are tables in sql?

1070


What type of join is sql join?

987


Define SQL and state the differences between SQL and other conventional programming Languages?

1222


Differentiate between sga and pga.

1167


Is it possible to create startup or shutdown trigger for on-schema?

1030


Define tables and fields in a database

1136