方式一:
--select @p_AllPARTOFCHECK = (select CAST(t.PARTOFCHECK as varchar)+'|' from QUEUEDETAIL t where t.APPOINTSID = @p_APPOINTSID for xml path('') )
--select @p_AllDirection = (select CAST(t.DIRECTION as varchar)+'|' from QUEUEDETAIL t where t.APPOINTSID = @p_APPOINTSID for xml path('') )
拼接结构如:字符串A|字符串B|
方式二:
select @p_AllPARTOFCHECK = (stuff((select '|' + PARTOFCHECK from QUEUEDETAIL where appointsid = @p_APPOINTSID for xml path('')),1,1,''))
select @p_AllDirection = (stuff((select '|' + direction from QUEUEDETAIL where appointsid = @p_APPOINTSID for xml path('')),1,1,''))
拼接结构如:字符串A|字符串B
注:具体拼接分割符,可自行定义使用,示例中使用 | 进行拼接