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

Why do you partition data?

1066


When can we use the where clause and the having clause?

1082


Is sql port 1433 encrypted?

1086


What problem one might face while writing log information to a data-base table in pl/sql?

1248


What is a column in a table?

1186


What is a database event trigger?

1210


what happens if null values are involved in expressions? : Sql dba

1092


what is an extent ? : Sql dba

1158


Which table is left in join?

1017


how to create a new view in mysql? : Sql dba

986


How will you distinguish a global variable with a local variable in pl/sql?

1201


What is the maximum number of columns in sql table?

1228


How can you save or place your msg in a table?

1039


who introduced sql?

1072


What are the operators used in select statements?

1097