SQL SERVER 如何把1列多行数据 合并成一列显示,具体格式如下:
查询表:
id title
1 title1
2 title2
3 title3
要求现实:
title1,title2,title3
id title
1 title1
2 title2
3 title3
要求现实:
title1,title2,title3
select stuff((select ','+title from tb for xml path('')),1,1,'')
SQL SERVER 截取字符
substring(Floor,0,(len(Floor)-1)
SQL SERVER 转换字符
cast(Floor as int )