行列转换,将列数据转换为字符串输出 ) SET @center_JZHW = ( SELECT DISTINCT STUFF( ( SELECT ',' + ce_code FROM ap_center WITH ( NOLOCK ) WHERE CE_PROVINCE = '浙江省' ORDER BY ce_code , , '') AS jzhw FROM ap_center t) SELECT @center_JZHW 运行结果如下图,列CE_CODE用分隔符','输出 Function写…