Today in an interview I was given this problem statement to solve:
MySQL:
There is a column, say "Salary", in a table. The data type of the column "Salary" is, off course, number. Fetch the record with the 5th Highest Salary.
Table may look like this:
Code: Select all
Sr_No Salary
1 5000
2 7500
3 20000
4 22500
5 25000
6 27500
7 5000
8 7500
9 15000
10 10000
Code: Select all
9 15000I would like to add one problem here:
How to fetch top 5 records, salary-wise, from the above table?