select
(select MouldName from mould_Mould where MouldCode=a.MouldCode) MouldName,
(select Specs from mould_Mould where MouldCode=a.MouldCode) MouldSpecs,
STUFF((
SELECT ',' + f.ProcessName
FROM mes_Process f
WHERE CHARINDEX(',' + f.ProcessCode + ',', ',' + a.ProcessCode + ',') > 0
FOR XML PATH(''), TYPE
).value('.', 'VARCHAR(MAX)'), 1, 1, '') AS ProcessName,
* from [dbo].[mould_MaterialBindMould] a where 1=1
标签:mould,编码,MouldCode,sqlserver,王五,where,select From: https://www.cnblogs.com/yjm8023/p/17853984.html