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 / ankur maheshwari

select abs(sum(c1.amounts)-sum(d1.amounts)) 'Amount
difference' from account c1, account d1 where
c1.accounts='c' and d1.accounts='d'

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between joins and union?

1196


What is sql entity?

1175


What is varchar sql?

1207


What is using in sql?

1141


What is the difference between local variables and global variables?

1180


Which column of the user triggers data dictionary view displays the database event that will fire the trigger?

1072


What does select * from mean in sql?

3337


What is sql*loader?

1285


mention if it is possible to import data directly from t-sql commands without using sql server integration services? If yes, what are the commands? : Transact sql

1097


What is full join?

1022


What will you get by the cursor attribute sql%notfound?

1131


How do you define a foreign key?

1067


What is procedure and function in sql?

1045


How many sql databases can you have on one server?

1155


What is a primary key called that is made up of more than one field?

1393