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

What is sqlcontext?

986


Why do we use joins?

984


What is a call statement? Explain with an example.

951


How many types of cursors supported in pl/sql?

1093


What is pl sql collection?

920


What do you understand by pl/sql records?

960


How do I debug a stored procedure?

1038


What is break?

1140


What is scope of pl sql developer in future?

949


What is a string data type in sql?

958


how to rename an existing table in mysql? : Sql dba

1005


What is the largest value that can be stored in a byte data field?

956


Is mariadb nosql?

990


How do you bind variables in pl sql?

1034


How do I truncate a word?

997