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 are the types of lock supported by ?
Sql studio em braces a variety of capabilities, but will I need them all? Is there a simpler product ? : sql server management studio
When multiple after triggers are attached to sql table, how to control the order of execution?
How can you append an identity column to a temporary table?
What is implicit cursors?
What are trace files?
Do you know the different ddl commands in sql?
What are the mathematical functions supported by sql server 2005?
Can I delete event logs?
What is 1nf normalization form?
What is the maximum size of sql server database?
How do clustered indexes store data?
Explain about service Broker functions?
Explain powershell included in sql server 2008?
Why and when do stored procedure recompile?