Syntax:
- Select salary from EmpDetails e
- where (n-1)=
- (select distinct(count(salary))
- from EmpDetails f
- where
- e.salary<f.salary)
Example: Find the 2nd highest salary from table Employee:
- select salary from EmpDetails e
- where(1)=
- (select distinct(count(salary))
- from EmpDetails f
- where
- e.salary<f.salary)