select '''' + ID +''',' from 表 for xml path('') 此SQL语句,输出结果如‘1’,’2‘,’3‘, 但是在因xml会出现path转译的问题将‘转成&apos 解决方案: select (select '''' + ID +''',' from 表 for xml path(''),Type).value('.','NVARCHAR(MAX)')
The Q-quote delimiter can be any single- or multibyte character except space, tab, and return. If the opening quote delimiter is a [, {, <, or ( character, then the closing quote delimiter must be the corresponding ], }, >, or )character. In all oth