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

What is the default isolation level in sql server? : Transact sql

1089


What is an emotional trigger?

1058


What is the difference between delete, truncate and drop command?

1228


How is sql used in oracle?

1039


What are the different types of database management systems?

1037


How do you sort in sql?

1071


Describe sql comments?

1115


What does := mean in pl sql?

1091


Write a sql query to find the names of employees that begin with ‘a’?

1058


What has stored procedures in sql?

1104


Why do we go for stored procedures?

1127


Is primary key a clustered index?

1014


what is sql profiler? : Sql dba

1115


How much does sql cost?

1067


How to select unique records from a table?

1111