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 need to know how i display department which has salary >
=5000 for the below table
Department
-----------
salary deptname
1000 a
3000 a
2000 b
3000 b
4000 c
5000 c

kindly send the query to thilakvinoth13@gmail.com

Answer Posted / mahesh

Hi dear,
1) If you have need name of total salary of each department to spend on employee(Understand like this) then use query:
select deptname, SUM(salary)
from Department
GROUP BY deptname
HAVING SUM(salary) >= 5000;

2) Otherwise

SELECT deptname
FROM Department
WHERE salary >= 5000;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

List some advantages and disadvantages of stored procedure?

1019


OPTIMIZATION OF SP,CURSOR,TRIGGERS

2792


What are the components of dbms?

959


Can we use pragma autonomous_transaction in trigger?

972


What are the disadvantages of using querystrings to send data from one page to another?

1010


What does it mean to be in union?

942


What is buffer cash in sql server?

1162


What is report subscription?

128


what authentication modes does sql server support? : Sql server database administration

1121


What is meant by Active-Passive and Active-Active clustering setup?

1186


Where is my database stored on the hard disk in ms sql server?

1072


if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration

996


To automatically record the time on which the data was modified in a table, which data type should you choose for the column?

967


Can you force a query to use a specific index?

954


How can we use ConnectorJ JDBC Driver with MS SQL?

1008