例如student表: studentID studentName studentScore 01 Alice 90 02 Bill 95 03 Cindy 100 一.拼接多个字段的值 select studentID+‘-’+studentName+'-'+studentScore AS studentInfo from student 结果: 二.一个字段多条记录的拼接 select stuff((select '|'+studentName from student for xm…
如student表: studentID studentName studentScore 01 Alice 90 02 Bill 95 03 Cindy 100 一.拼接多个字段的值 select studentID+‘-’+studentName+'-'+studentScore AS studentInfo from student 结果: 二.一个字段多条记录的拼接 select stuff((select '|'+studentName from student for xml p…