select stuff((select ','+A.CarType from (select distinct CarType from #tempCarType) A FOR xml PATH('')), 1, 1, '') as CarType
#tempCarType为表名,CarType为字段名
SQL将一列多行数据转换为一行
最新推荐文章于 2024-07-23 15:38:58 发布
select stuff((select ','+A.CarType from (select distinct CarType from #tempCarType) A FOR xml PATH('')), 1, 1, '') as CarType
#tempCarType为表名,CarType为字段名