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

What is explicit cursors?

1007


How to use subqueries in the from clause in ms sql server?

1119


What do you understand by user-defined function in the sql server?

918


Can you name a few encryption mechanisms in sql server?

910


Why I have to use stored procedures?

991


your distribution database is full what will u do

2140


can you implement data mining in SSRS?

142


Tell me what are the advantages of using stored procedures?

962


on line cluster can we make if yes tell me the procedure

1991


How to divide query output into multiple groups with the group by clause in ms sql server?

988


How to create a simple user defined function in ms sql server?

986


How to turn off warning messages during php execution?

996


What are different types of schemas?

907


How many types of stored procedures are there in sql server?

973


How will you know when statistics on a table are obsolete?

1045