SELECT ',' + car.MainRouteName
FROM [dbo].[Car] car
WHERE car.Id = list.ListCarId and list.ListProductId =list.ListProductId AND list.ListStatus = 200 AND car.MainStatus = 200
FOR XML PATH('')
var list =db.database.sqlquery<实体名>(sql);
var result = from q in list where q.MainRouteName=="???" select q;
你都用linq了,说明用程序写的。你把数据查出来,用程序拼接数据就行了,合并在数据库里执行了