SELECT t.*,t1_l.*
FROM (SELECT 
	t0.FID
	,count(1) co
	,t0e.FCPID
FROM hw_mjcpdzb t0
	INNER JOIN hw_mjcpdzbs t0e on t0.FID = t0e.FID
GROUP BY
	t0.FID,t0e.FCPID
having
	count(1) >1) t 
	inner join hw_mjcpdzb t0 on t.FID = t0.FID
	inner join T_BD_MATERIAL_L t1_l on t1_l.FMATERIALID = t0.FMJID
