没有为 'c' 的列 1 指定任何列名称。

select @result=case when c.name2='801民营单位802政府单位' then '4|4' else '' end  from ( select (dwlxbm+dwlxmc) as name2  from jcbm_dwlx where uid=@user_name and (dwlxbm='801' or dwlxbm='802') FOR XML PATH('')) as c(name2)

原文地址:https://www.cnblogs.com/forthelichking/p/4784783.html