Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How to populate a table in sql server?

968


What are the various editions of sql server 2017 that are available in the market?

894


What is read uncmmited?

1069


What is the use of custom fields in report?

1000


What is format parameter in ssrs?

148


Explain index in sql server?

1024


What is replace and stuff function in sql server?

1073


What do you understand by the data quality services in sql server?

953


What are group functions in query statements in ms sql server?

1018


What are sql server procedures?

991


What is Federation Root Database?

104


How many types of the database links?

1077


What is change data capture (cdc) feature?

1074


What is an indice?

1045


What are the new features of sql server 2008 r2 reporting service?

209