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