Home >Database >Oracle >What is the statement to delete the emp table?

What is the statement to delete the emp table?

藏色散人
藏色散人Original
2020-10-16 11:34:084646browse

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;".

What is the statement to delete the emp table?

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn