SQL将一列多行数据转换为一行时间:2021-07-22 10:28:38select stuff((select ','+A.CarType from (select distinct CarType from #tempCarType) A FOR xml PATH('')), 1, 1, '') as CarType #tempCarType为表名,CarType为字段名