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 Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000

Answer Posted / tusar

select distinct (a.sal),empno from emp a
where &N = (select count (distinct(b.sal))
from emp b where a.sal <= b.sal);

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is built-in function?

932


What is a result set object returned by odbc_exec()?

958


Difference between Inner vs outer joins?

895


Explain the etl (extraction, transformation, and loading)?

940


What is sub-query in sql server? Explain its properties.

1043


What are the tool windows in sql server management studio? : sql server management studio

1018


List the different normalization forms?

929


How to use copy and concatenate commands in SQL?

1067


What are a database and a data warehouse?

972


What is log cache in sql server?

985


What are different types of raid levels?

1074


What programming language would you use to create embedded functions in ssrs?

172


How to list all schemas in a database?

1005


What are sp_configure commands and set commands?

959


How to enable/disable indexes?

1016