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

List out the different types of locks available in sql server?

964


What are the new scripting capabilities of ssms? : sql server management studio

1038


how you can list all the tables in a database?

1012


How to maintain a fill factor in existing indexes?

984


What happens if null values are involved in comparison operations?

945


What stored procedure can you use to display the current processes?

871


What are the new features introduced in SQL Server 2000? What changed between the previous version of SQL Server and the current version?

2345


how we use window authentication connection with sql server.?

1134


What is the maximum row of a size?

995


What does asynchronous call backs means?

1127


How can we call UDF(User Define Function) using C# code in ASP.net ?

6861


How do I start and stop sql server?

1002


Why are you getting errors when creating a new odbc dsn?

1200


Please differentiate between a local and a global temporary table?

982


What do you mean by recursive stored procedure?

934