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

find 2nd highest salary of person using cursor concept?

Answer Posted / jcreddy

select e1.salary from employee e1
where 1 = (select count(salary) from employee e2 where
e1.salary < e2.salary)
order by marks asc
-- by changeing from '<', to '>' you will get min salary

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to convert a table data in XML format in sql server?

2526


Can we delete data from a view?

912


Explain Capacity planning to create a database? and how to monitor it?

4181


How many full-text indexes can a table have?

961


Can I disable or restrict ssrs export formats (rendering formats)?

148


How to delete duplicate rows from table except one?

971


Explain the concepts and capabilities of sql server?

957


Define primary key?

1114


What structure can you implement for the database to speed up table reads?

1180


What is difference between count (*) and count 1?

913


You have a stored procedure, which execute a lengthy batch job. This stored procedure is called from a trigger you do not want to slow the data entry process you do not want trigger to wait for this batch job to finish before it completes itself what you can do to speed up the process?

1116


What are data files?

1024


What are the differences between triggers and stored procedures?

1038


How do I find the default sql server instance?

928


What is openrowset sql server?

1104