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

Is sql a backend?

1073


What is materialized view. What are different methods of refresh?

1440


What is trigger and stored procedure in sql?

1093


What are the query optimization techniques?

1000


What are all the common sql functions?

1084


How do I save a sql query?

1067


define data blocks ? : Sql dba

1047


What is null in pl/sql?

1121


What are all ddl commands?

1129


What is pl sql architecture?

1003


What is sql entity?

1174


What is the difference between execution of triggers and stored procedures?

1156


Explain the purpose of %type and %rowtype data types?

976


what is a scheduled jobs or what is a scheduled tasks? : Sql dba

1014


How do I remove all records from a table?

1117