Home > Database > Oracle > body text

What is the statement to delete the emp table?

藏色散人
Release: 2020-10-19 14:24:25
Original
4572 people have browsed it

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;
Copy after login

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);
Copy after login

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!

Related labels:
emp
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!