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

What is full outer join in sql server joins?

1139


How to test a dml trigger in ms sql server?

1114


Explain indexed views?

1028


On a windows server 2003 active – passive failover cluster, how do you find the node which is active?

1249


What is log shipping? Can we do logshipping with SQL Server 7.0 - Logshipping is a new feature of SQL Server 2000. We should have two SQL Server - Enterprise Editions. From Enterprise Manager we can configure the logshipping. In logshipping the transactional log file from one server is automatically updated into the backup database on the other server. If one server fails, the other server will have the same db and we can use this as the DR (disaster recovery) plan.

2811


Can a database be shrunk to 0 bytes, if not, why?

1162


How to define output parameters in stored procedures?

1082


what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration

1049


Do you know the cursor types?

1205


Explain Reporting Life Cycle?

132


How do you run a trace?

946


explain how to create a new schema in a database? : Sql server database administration

1156


Can we update data in a view?

1080


What are the steps you should follow to start sql server in single-user mode?

951


How to deploy the Report?

140