Monday, 25 September 2017

how to find nth salary in mysql

select  salary from (SELECT DISTINCT salary FROM employee order by salary DESC LIMIT 1)as result order by salary ASC limit 1

how to find the second max salary

select max(salary) from employee where salary <(select max(salary) from employee)

how to find the max salary in my sql

select max(salary) from employee

Friday, 15 September 2017