Toto funguje pro mě (bylo by jednodušší, kdybyste poskytli nějaká data k testování):
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