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

Does server sql treat char as a variable-length or fixed-length column?

950


Is sql server is free?

921


How to get the number of affected rows?

948


Your company has 50 branches all over the country all the branches, including the head office have sql server as the database every night all 50 branches upload certain information to the head office which replication topology is best suited for the above scenario?

1069


In which format does an image save in SQL Server database ?

945


Can we update data in a view?

969


Can two tables share a primary key?

949


Can we add a cpu to sql server?

957


Explain primary key, foreign key and unique key?

933


What is the difference between seek predicate and predicate?

986


Explain the steps needed to create a scheduled job?

883


Where is my database stored on the hard disk in ms sql server?

994


How do I partition a table in sql server?

984


What do you mean by a dependent functionality in a build?

1062


What is the difference between resultset and resultsetmetadata?

891