Makerea


#1

FROM (
SELECT dep_month,
dep_day_of_week,
dep_date,
distance, /* you need to select distance, or else your a.distance wont find anything, since it's only looking at data in the table with alias 'a' */
COUNT(*) AS flight_distance
FROM flights
GROUP BY 1,2,3
) a