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

What is row-level compre?

945


what is package and it uses and how can u call a package

1955


Name some of the open source software that you can use in alternative to SSR?

151


What is the sql case statement used for?

1037


Can we use max in where clause?

882


What is delete query?

898


What are the components of sql server service broker?

948


What are the security related catalog views? : sql server security

914


Do you know how to send email from database?

930


Explain isolation levels that sql server supports?

988


State the difference between local and global temporary tables?

1052


What is microsoft sql server?

914


Indexes are updated automatically is the full-text index also updated automatically?

979


what is hash nonclustered index

910


What is a derived table?

872