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 / 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


Please Help Members By Posting Answers For Below Questions

When does a workload on SQL Azure get throttled?

129


What is a document index?

974


Differentiate between mongodb vs. Sql server?

1028


What are cursors and when they are useful?

1009


Can truncate be rolled back?

884


How to turn off warning messages during php execution?

981


What is the difference between varchar and varchar(max) datatypes?

999


Is sql server 2016 free?

879


Explain identity in sql server?

948


How do you troubleshoot errors in a SQL Server Agent Job?

1004


What is openrowset sql server?

1056


What is buffer cash in sql server?

1094


List down some advantages of sql stored procedure?

900


What do you understand by replication in sql server? Mention the different types of replication in sql server.

892


What are different types of statements that are supported by sql?

979