22,298
社区成员
发帖
与我相关
我的任务
分享
create table T(N int, B varchar(10), C varchar(10), D decimal(10,1))
insert T select 1,'n1','c1',1.1
union all select 2,'n1','c1',1.1
union all select 3,'n1','c1',1.3
union all select 4,'n1','c2',1.1
union all select 5,'n1','c2',1.2
union all select 6,'n1','c2',1.2
union all select 7,'n2','c3',1.5
union all select 8,'n2','c3',1.5
union all select 9,'n2','c4',1.5
union all select 10,'n2','c4',1.5
union all select 11,'n2','c4',1.6
union all select 12,'n2','c5',1.6
select * from T
select * from T as tmp
where (select count(*) from T where B=tmp.B and C=tmp.C and D=tmp.D)>1