0 votes
1.4k views
in MySQL by
I want to know n'th highest value from a column of a table. eg: 2nd highest salary from `employee` or 4th highest salary from `employee`. Where `employee` is mysql database table.

1 Answer

0 votes
by

2nd highest salary record:

SELECT * FROM employee ORDER BY salary  DESC LIMIT 1,1;

4nd highest salary record:

SELECT * FROM employee ORDER BY salary  DESC LIMIT 3,1;

Where n'th is 1 and 3. It shows positions.

Share:- Whatsapp Facebook Facebook


Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

Categories

...