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

Explain Normalization and DE normalization

1160


How to create prepared statements using odbc_prepare()?

1102


How to name query output columns in ms sql server?

1014


What are the advantages of log shipping?

1039


Give a example to search fr a string in all stored procedure in sql server.

1063


Can an entity have two primary keys?

1030


Do you know what are various aggregate functions that are available?

1215


how you can move data or databases between servers and databases in sql server? : Sql server administration

1030


How to define the name and server for a new dsn?

1196


How to verify the port number of the sql server?

1251


What is “asynchronous” communication in sql server service broker?

1080


What does the on update no action do?

1078


What are the difference between clustered and a non-clustered index?

1090


How do I setup a sql server database?

1129


what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration

1032