打印本文 打印本文 关闭窗口 关闭窗口
在SQL中删除重复记录(多种方法)
作者:武汉SEO闵涛  文章来源:敏韬网  点击数10539  更新时间:2007/11/14 13:08:45  文章录入:mintao  责任编辑:mintao
e1.salary=e2.salary);--这里用min(rowid)也可以。

 

SQL>delete from employee e2 where rowid <(
       
select max(e1.rowid) from employee e1 where
        e1.emp_id
=e2.emp_id and e1.emp_name=e2.emp_name and

                  e1.salary=e2.salary);

 

3)也是通过rowid,但效率更高。

SQL>delete from employee where rowid not in (
       
select max(t1.rowid) from employee t1 group by

         t1.emp_id,t1.emp_name,t1.salary);--这里用min(rowid)也可以。

 

 

 << 上一页  [11] [12]  下一页

打印本文 打印本文 关闭窗口 关闭窗口