SELECT DISTINCT imaa005 类型,xcad001 as 版本,xcad010 序号,xcad003 as 料号,xcad002 上级料号,imaal004 零件名,xcadua001 良率,xcadua007 版数from xcad_t --bom表join imaal_t il2 on xcadent=il2.imaalent and xcad003=il2.imaal001 and il2.imaal002='zh_CN'--关联产品、半成品规格说明left join imaa_T ON imaaent=imaalent AND imaa001=imaal001left join xcah_t on xcadent=xcahent and xcad001=xcahua002 and xcad002=xcah040 and xcad003=xcah022 --标准成本表where xcadent=88 and xcad001='V测试-H6'and imaa005 is not null order by xcad010,imaa005 ASCSJZX001 上级料号 是 SJZX-3DFHBSJZX-3DFHB 上级料号 是 SJZXBCPZC1也就是说 SJZX001、SJZX-3DFHB 2个料号最终都要汇总到 SJZXBCPZC1