我正在尝试从表格中删除员工第二高的薪水,但是我找不到正确的答案。
delete FROM user
where salary =(select max(salary) from user where salary<(select max(salary) from user));
答案 0 :(得分:0)
将子查询嵌套到另一个查询中:
delete FROM user
where salary = (select t.sal from (
select max(salary) sal from user where salary < (select max(salary) from user)
) t
);