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
What is an entity-relationship diagram (erd)?
Why does sql studio use a single registered database repository? : sql server management studio
Thanks to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
What is view in sql?
Difference between group by clause and having clause in SQL?
What the different components in replication and what is their use?
What is use of dbcc commands?
What are security principals used in sql server 2005?
Explain what are sparse columns?
What are exact numeric data types in ms sql server?
What is 2nf normalization?
Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?
whats new about truncate in sql server 2008?
How do you trace the traffic hitting a sql server?
How can we migrate from SQL server to SQL Azure?