第1个回答 2010-08-15
1、 先找出B字段中的数值的数量
select B字段, count(B字段) as num from 数据表 group by B字段
2、 先找出B字段中的重复值的记录值
select B字段, count(B字段) as num from 数据表 group by B字段
就是 num >1 的记录集
3、 求解
select a.A字段,a.B字段,a.C字段
from 数据表 a,
( select B字段, count(B字段) as num from 数据表 group by B字段) b
where a.B字段 = b.B字段 and b.num>1
第2个回答 2010-08-15
select A,表.B,C from test01 join
(select count(B) as Q,B from 表
group by B
having count(B)=2) as T on 表.B=T.B
表是你所创建的表名
第3个回答 2010-08-15
假设表的名字为t1:
select * from t1 where b in (select b from t1 group by b having count(b)>1)本回答被提问者采纳
第4个回答 2010-08-15
select * from 表 where B in(select B from 表 group by B having count(*)>1)