7 lines
227 B
HTML
7 lines
227 B
HTML
<pre>SELECT STUFF((SELECT ',' + FieldName FROM TableName FOR XML PATH('')),1,1,'') AS T
|
|
</pre>
|
|
<pre>其中的逗号可以换成其它字符
|
|
</pre>
|
|
<pre>转换完成后的结果如下:
|
|
</pre>
|
|
<pre>111,222,333,444,555,666</pre> |