これは私にとってはうまくいきます (テスト用のデータを提供すると、より簡単になります):
SELECT C.CarName, SUBSTRING(( SELECT ', ' + CAST(CarMileage / TotalGasTrips AS VARCHAR(MAX)) FROM Mileage WHERE Mileage.CarName = C.CarName GROUP BY dbo.Mileage.CarMileage, dbo.Mileage.TotalGasTrips FOR XML PATH('') ), 2, 1000) AS MPGString FROM Car C JOIN dbo.Mileage M ON C.CarName = M.CarName GROUP BY C.CarName
プレ>