1.
select cInvCode from dbo_Inventory where cInvCode Like '%-3-%' and cInvCCode='0114'2-4不是很明白你的意思
select cInvCode from dbo_Inventory where cInvCode Like '%-3-%' and cInvCCode='0114'2-4不是很明白你的意思
结果如:LDY1-3-000
LDY1-3-001
LDY1-3-002
LDY1-3-003
LDY1-3-004
LDY2-3-000
LDY2-3-0012、然后选择出dbo_ProductStructures表里cPSPCode字段有上边结果的内容.
3、要选择出dbo_ProductStructures.cPSPCode like "LDY1000*" or like "LDY1001*" or....的内容
4、选择出dbo_ProductStructure.cPSPCode字段有上边结果的内容
FROM dbo_ProductStructures a
INNER JOIN ( SELECT cInvCode
FROM dbo_Inventory
WHERE (dbo_Inventory.cInvCode Like "????-3-???")
AND (dbo_Inventory.cInvCCode="0114")
) b
ON a.cPSPCode = b.cInvCode
OR a.cPSPCode Like ''''+ Replace(b.cInvCode,'-3-','') + '*'+''''
)