select distinct field1,field2..... from tablename where .... group by ...order by ...
--查询分析器重执行一下 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
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