刪除emp表的語句是“delete from emp where (deptno,sal) in (select deptno,max(sal) from emp group by deptno);commit;”。
推薦:《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