sqlserver 用 STUFF 和 for xml path 把查询结果连接成字符串
select STUFF((select ","+location_id from t_zone_loca where dps_item="xhzlqbzp" ORDER BY location_id for xml path("")),1,1,"")
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
select STUFF((select ","+location_id from t_zone_loca where dps_item="xhzlqbzp" ORDER BY location_id for xml path("")),1,1,"")