select distinct ... from ... where ...

解决方案 »

  1.   

    用Dsitinct 控制如﹕select distinct 字段列表 from 表名 ...
      

  2.   

    select distinct * from tb where ...
      

  3.   

    select distinct * from tb where ...
      

  4.   

    select distinct field1,field2..... from tablename where .... group by ...order by ...
      

  5.   

    --查询分析器重执行一下
    declare @table2 table(mobile varchar(100),fee int,k int)
    insert into @table2 
    select '13800000000',10,1
    union all select '13900000000',15,7
    union all select '13800000000',2,1
    union all select '13800000000',5,1
    union all select '13900000000',15,8
    union all select '13700000000',50,6
    union all select '13800000000',2,1
    union all select '13700000000',50,6
    select * from @table2 order by mobile
    select * from @table2 group by mobile,fee,k having count(mobile)>1