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

Is mysql better than sql server?

1106


What will be the value of @@fetch_status if a row that was a part of the cursor resultset has been deleted from the database after the time the stored procedure that opened the cursor was executed?

1192


What are the types of normalization?

1076


Where are full-text indexes stored?

1036


What do you understand by mirroring?

1044


what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration

1047


Where are stored procedures in sql server?

1124


Does hive support indexing?

999


What are the differences between char and varchar in ms sql server?

1122


What is indexed view? How to create it?

1068


How to create stored procedures with parameters in ms sql server?

1155


Give the query of getting last two records from the table in SQL SERVER?

1008


Is it possible to have clustered index on separate drive from original table location?

1015


How to use old values to define new values in update statements in ms sql server?

1330


What is mapping schema?

1068