Начать с группы по:
SELECT SUM(Ride_distance),Ride_type FROM rides GROUP BY Ride_type
Если они должны быть в одном ряду, используйте pivot :
SELECT 'TotalRide' as Total_Ride_Length, [A], [B], [C]
FROM
(SELECT Ride_distance, Ride_type FROM rides) AS SourceTable
PIVOT (
SUM(Ride_distance) FOR Ride_type IN ([A], [B], [C])
) AS PivotTable;