表1mobile
10000
10000
20000
30000
30000
40000我想用语句变成
表1mobile
10000
20000
30000
40000

解决方案 »

  1.   

    select distinct mobile # into #a from tablename
    delete tablename
    insert into tablename(mobile)
       select mobile from #a
    drop table #a
      

  2.   

    delete form 表1 where mobile not in (select mobile from 表1 group by mobile)或者用distinct mobile
    如果只用第一位做判断就把所有的mobile换为left(mobile,1)
      

  3.   

    先用distinct 把不重复的筛选处理插入到临时表中 在把所有的记录全部删除掉后把临时表中的记录插入到原来的表中就可以了 在把临时表删除掉