假设产品名、部件号、部件名称分别用product_id, component_id, component_name表示,表的名称为tbl
SELECT product_id, component_id, component_name,count(component_id)
FROM tbl
WHERE count(component_id)>100
GROUP BY( product_id )
select *,(select count(*) from table where 产品号=aaa.产品号) as 部件总数 from table as AAA where 产品号 in
(select 产品号 from table group by 产品号 having count(*) >100)