Hi
In the emp table we want third heighest salary in this table by sql command
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Jan 20, 2012, 1:15 AM
select distinct(salary) from employee A where 3=(select count(distinct(salary)) from employee B where A.salary<=B.salary)
Thanks
Mukesh KumarPosted Jan 20, 2012, 12:40 AM
Try this
SELECT TOP 1 salaryFROM (
SELECT DISTINCT TOP 3 salary
FROM employee
ORDER BY salary DESC) a
ORDER BY salary
Dhaval PatelPosted Jan 20, 2012, 12:31 AM
refer below link
http://www.c-sharpcorner.com/Blogs/7111/how-to-get-second-highest-and-lowest-record-in-sql-server.aspx
use this query
Thanks
Dhaval Patel
This post help you than Mark As Accepted Answer