日期:2014-05-17 浏览次数:20942 次
select e.* from employee e where rowid > (select min(rowid) from employee b where e.employee_id = b.employee_id)
delete from employee where rowid not in ( select min(rowid) from employee group by employee_id )
------解决方案--------------------
select job from (select job,row_number()over (partition by job order by job )rn from emp) --要按什么删除 order by里 排下序就可以了
------解决方案--------------------
然後 我用手動的方法找到一個相同的id=‘123’ 用123這個id去查詢rowid 可是也只能查到一個rowid 可是123的數據明明是重復的 為什么呢?
--------------------------------------------------
你是如何确认这条数据明明是重复的?估计是你没有commit
------解决方案--------------------
DELETE FROM EMPLOYEE E2 WHERE ROWID NOT IN (SELECT MAX(E1.ROWID) FROM EMPLOYEE E1 WHERE E1.EMPLOYEE_ID = E2.EMPLOYEE_ID);
------解决方案--------------------
删除的方法是对的,查看有没有提交