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
When does a workload on SQL Azure get throttled?
What is a document index?
Differentiate between mongodb vs. Sql server?
What are cursors and when they are useful?
Can truncate be rolled back?
How to turn off warning messages during php execution?
What is the difference between varchar and varchar(max) datatypes?
Is sql server 2016 free?
Explain identity in sql server?
How do you troubleshoot errors in a SQL Server Agent Job?
What is openrowset sql server?
What is buffer cash in sql server?
List down some advantages of sql stored procedure?
What do you understand by replication in sql server? Mention the different types of replication in sql server.
What are different types of statements that are supported by sql?