How to find 3rd maximum or nth maximum salary in MySQL?
In this tutorial, we will discuss about two methods for finding nth maximum salary first one is using subquery and the second one is using the aggregate function. this is the most common question asked in interviews
SubQuery:
- A Subquery or Inner query or a Nested query is a query within another SQL query and embedded within the WHERE clause.
- A subquery is used to return data that will be used in the main query as a condition to further restrict the data to be retrieved.
- Subqueries can be used with the SELECT, INSERT, UPDATE, and DELETE statements along with the operators like =, <, >, >=, <=, IN, BETWEEN, etc.
Aggregate function:
aggregate function or aggregation function is a function where the values of multiple rows are grouped together to form a single summary value. Common aggregate functions include Average (i.e., arithmetic mean), Count.

Creat Table and insert some data:
Select Nth maiximum or highest salry
Select 3rd maximum salary