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
Explain Normalization and DE normalization
How to create prepared statements using odbc_prepare()?
How to name query output columns in ms sql server?
What are the advantages of log shipping?
Give a example to search fr a string in all stored procedure in sql server.
Can an entity have two primary keys?
Do you know what are various aggregate functions that are available?
how you can move data or databases between servers and databases in sql server? : Sql server administration
How to define the name and server for a new dsn?
How to verify the port number of the sql server?
What is “asynchronous” communication in sql server service broker?
What does the on update no action do?
What are the difference between clustered and a non-clustered index?
How do I setup a sql server database?
what are the different ways of moving data/databases between servers and databases in sql server? : Sql server database administration