ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 查询重复记录

查询重复记录

原创 Linux操作系统 作者:rocky_gao 时间:2011-07-09 14:49:31 0 删除 编辑
select count(*)  from SMARTSTG.PROMOTIONU;
select count(*) from (select distinct * from SMARTSTG.PROMOTIONU);

select * from SMARTSTG.PROMOTIONU a
where (a.MUNMBR,a.MULINE) in (select MUNMBR,MULINE from SMARTSTG.PROMOTIONU group by MUNMBR,MULINE having count(*) > 1);

select rowid,MUNMBR,MULINE from SMARTSTG.PROMOTIONU a
where (a.MUNMBR,a.MULINE) in (select MUNMBR,MULINE from SMARTSTG.PROMOTIONU group by MUNMBR,MULINE having count(*) > 1)
and   rowid not in (select min(rowid) from SMARTSTG.PROMOTIONU group by MUNMBR,MULINE having count(*)>1);

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11976525/viewspace-701752/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-04-09

  • 博文量
    112
  • 访问量
    278978