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

how to find the second highest salary from emp table?

Answer Posted / naveed saleh

You can use this for getting nth highest salary from
Employee table as follows

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP n salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
where n > 1 (n is always greater than one)

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How global cursor can be declare with dynamic trigger ?

2145


Explain what is table in a database?

1002


What is the difference between function and procedure in pl/sql?

1013


Difference between truncate, delete and drop commands?

1022


What is a schema sql?

1050


What are the benefits of triggers?

1119


Explain the working of primary key?

1033


How do I count rows in sql query?

937


What is record data type?

857


What is database migration?

912


how to include numeric values in sql statements? : Sql dba

1038


what is the difference difference between procedure and packages

10245


Write a query to find the names of users that begin with "um" in sql?

923


How do I start sql from command line?

961


what is transaction? : Sql dba

958