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 / sahil
The query will be to get the total of salary >= 5000 in a
department is :
select deptname, sum (salary) as totalsalary from Department
group by deptname
then it will shown like
deptname total salary
a 4000
b 5000
c 9000
now we will get the highest total salary from department
remember group by is always used to group-set.
select deptname, sum (salary) from Department
group by deptname
having sum (salary) >= 5000
Then you will get the answer!!
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
How to populate a table in sql server?
What are the various editions of sql server 2017 that are available in the market?
What is read uncmmited?
What is the use of custom fields in report?
What is format parameter in ssrs?
Explain index in sql server?
What is replace and stuff function in sql server?
What do you understand by the data quality services in sql server?
What are group functions in query statements in ms sql server?
What are sql server procedures?
What is Federation Root Database?
How many types of the database links?
What is change data capture (cdc) feature?
What is an indice?
What are the new features of sql server 2008 r2 reporting service?