The statement to delete the emp table is "delete from emp where (deptno,sal) in (select deptno,max(sal) from emp group by deptno);commit;".
Recommended: "oracle tutorial"
oracle database delete emp table
Delete the employees with the highest salary in each department from the emp table.
The deletion statement is:
delete from emp where (deptno,sal) in (select deptno,max(sal) from emp group by deptno); commit;
To avoid deletion errors, select and confirm before performing the deletion operation:
select * from emp where (deptno,sal) in (select deptno,max(sal) from emp group by deptno);
The above is the detailed content of What is the statement to delete the emp table?. For more information, please follow other related articles on the PHP Chinese website!