是别人用excel输入的不小心输入重复了
我可以用
select hm_id,count(hm_id) from xx group by hm_id having count(hm_id)>1
查出是哪条记录,不过如果很大的话不是很麻烦,有没有直接用delete 的语句?

解决方案 »

  1.   

    如果很大的话不是很麻烦,有没有直接用delete 的语句?
      

  2.   

    如果很大的话不是很麻烦,有没有直接用delete 的语句?
      

  3.   

    使用DISTINCT的例子:
    找出所有出售loptop的maker
    select distinct maker
    from product
    where model in (select model from loptop);
      

  4.   

    全部删除:
    delete from table where (select count(*) >1 from table group by column1)
      

  5.   

    set rs=cn.execute "select distinct hm_id,count(hm_id) from xx group by hm_id"
     cn.execute"delete  xx"
     cn.execute"insert xx("hm_id",count(hmid)) values (rs!hm_id,rs!count(hm_id))"
      

  6.   

    错了,应该是"insert into "