id 字段A 字段B 字段C 字段D
1 001 a1 a2 a3
2 002 b2 b2 b3
3 001 a1 c2 c3
4 001 a1 d2 d3
如何字段a及字段b同时重复的挑出来?我用select * from biao group by a,b
这样分组,如何得到每组准确的数字和位置
1 001 a1 a2 a3
2 002 b2 b2 b3
3 001 a1 c2 c3
4 001 a1 d2 d3
如何字段a及字段b同时重复的挑出来?我用select * from biao group by a,b
这样分组,如何得到每组准确的数字和位置
where exists
(select 1 from table1 where 字段A=A.字段A and 字段B=A.字段B and ID<A.ID )
-------------
对你的表,上面sql是不对了
select * from
(select a,b
from biao group by a,b
having count(1)>1) y where y.a=x.a and y.b=x.b)
select 1 from
(select a,b
from biao group by a,b
having count(1)>1) y where y.a=x.a and y.b=x.b)