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 / vijay sinha

select (select sum(amount) from table_name where account = 'C') - (select sum(amount) from table_name where account = 'D')

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

tell me about various levels of constraint. : Sql dba

1041


What is an escape character in sql?

1039


How do you add a column to a table?

1065


What is cartesian join in sql?

1139


Can we insert data into view?

910


Which join is like inner join?

1043


How do I filter in sql profiler?

1003


what is the different between now() and current_date()? : Sql dba

1030


what is try_catch block in procedure

1757


What are procedures used for?

993


Is it possible to link two groups inside a cross products after the cross products group has been created?

1009


How many types of triggers are there in pl sql?

1075


What is attribute indicator in pl sql?

1019


How do you update f as m and m as f from the below table testtable?

1864


What is use of trigger?

941