I am trying to delete the second highest salary of an employee from a table but I am not able to find out the correct answer.
delete FROM user
where salary =(select max(salary) from user where salary<(select max(salary) from user));
I am trying to delete the second highest salary of an employee from a table but I am not able to find out the correct answer.
delete FROM user
where salary =(select max(salary) from user where salary<(select max(salary) from user));
Nest the subquery inside another one:
delete FROM user
where salary = (select t.sal from (
select max(salary) sal from user where salary < (select max(salary) from user)
) t
);