how to find nth lowest salary

Answer Posted / mohd javed

For All SQL , Tested in PostgresSQL : Javedcc@gmail.com

SELECT * FROM <Table_Name> A
WHERE N = (SELECT COUNT(DISTINCT B.Column_Name ) FROM
<Table_Name> B WHERE A.Column_Name >= B.Column_Name)

Is This Answer Correct ?    8 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why Update is too slow

1025


How do I create a postgresql table using pgadmin?

446


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

466


How to change postgresql root user password?

537


How do you delete data on pgadmin?

513






How do you edit data in pgadmin?

472


What is a ctid?

557


Can we have multiple index on a table?

520


How do you create a table in pgadmin 4?

499


Do indexes speed up queries?

508


Is mysql a postgresql?

510


Is foreign key required?

482


What is performance_schema?

515


How do I connect to postgresql remotely?

495


What is postgresql and pgadmin?

430