刪除emp表的語句是什么

刪除emp表的語句是“delete from emp where (deptno,sal) in (select deptno,max(sal) from emp group by deptno);commit;”。

刪除emp表的語句是什么

推薦:《oracle教程

oracle數據庫刪除emp表

從emp表中刪除各個部門中具有最高工資的員工。

刪除語句是:

delete?from?emp?where?(deptno,sal)?in?(select?deptno,max(sal)?from?emp?group?by?deptno); commit;

避免刪錯,執行刪除操作前先select確認一下:

select?*?from?emp?where?(deptno,sal)?in?(select?deptno,max(sal)?from?emp?group?by?deptno);

? 版權聲明
THE END
喜歡就支持一下吧
點贊9 分享