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 is the use of geoserver?

442


What are string constants in postgresql?

442


What is a table catalog?

424


Does vacuum full reindex?

401


How to display error message in postgresql?

453






What is greenplum db?

417


What is the password of postgres user?

493


Is edb postgres free?

452


How many byte Unique integers does OIDs in PostgreSQL have?

944


Is postgres a mpp?

444


How to start, stop and restart postgresql database?

465


What is pg bouncer?

406


Is postgresql similar to sql server?

431


What is the driver name for postgresql?

419


Which key can be used to execute a query in the query editor?

392