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 a loop in sql?

984


How does stored procedure reduce network traffic?

1008


Is sql a backend?

1021


What is nvarchar in sql?

924


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

928


define data blocks ? : Sql dba

996


Is it possible to update views?

959


How do I remove sql plus from windows 10?

1097


What are records give examples?

1009


What is a recursive stored procedure?

1183


What is the process of debugging?

1070


Enlist some predefined exceptions?

1059


how mysql optimizes distinct? : Sql dba

1079


discuss about myisam index statistics collection. : Sql dba

951


What is a procedure in pl sql?

1211