
SELECT 
	TOP 1000
	T0E.FMATERIALID
	,T0E.FMATERIALIDSUB
FROM 
	T_PRD_PMPPBOMENTRY T0E
	INNER JOIN  T_PRD_PMPPBOMENTRY_A T0E_A ON T0E_A.FENTRYID = T0E.FENTRYID
WHERE T0E.FID = 101118
GROUP BY T0E.FMATERIALID,T0E.FMATERIALIDSUB


SELECT 
	TOP 1000
	t0E.*
	,T0E_A.*
FROM 
	T_PRD_LACKANALYSEBILL t0
	INNER JOIN T_PRD_PMPPBOMENTRY T0E on t0.FID = T0E.FID
	INNER JOIN  T_PRD_PMPPBOMENTRY_A T0E_A ON T0E_A.FENTRYID = T0E.FENTRYID
WHERE t0.FBILLNO = 'SCQL000671'