how to find nth lowest salary

Answer Posted / liju

nth lowest
nth lowest
*******************************************************
SELECT DISTINCT (A.sal) FROM EMP A WHERE (N-1) =

(SELECT COUNT (DISTINCT (b.sal)) FROM EMP B

WHERE b.sal<a.sal);

nth highest
*******************************************************
SELECT DISTINCT (A.sal) FROM EMP A WHERE (N-1) =

(SELECT COUNT (DISTINCT (b.sal)) FROM EMP B

WHERE b.sal>a.sal);

Is This Answer Correct ?    14 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the data types in postgresql?

434


What does postgresql stand for?

439


Is postgres a database?

434


What are the indices of postgresql?

462


Is postgresql a sql server?

476






Is postgresql like oracle?

434


How do you delete data on pgadmin?

446


What is the blob data type?

404


Is postgresql free to use?

422


What does postgresql do?

475


What is edb postgres?

459


How secure is postgresql?

442


Is postgresql better than oracle?

422


Is postgresql a database?

404


Is primary key indexed by default?

441