4/7 Non-Correlated Subqueries III


#1

The following code, what does “a” syntax mean, since that is not the column title?

SELECT **a.**dep_month,
**a.**dep_day_of_week,
AVG(**a.**flight_count) AS average_flights
FROM (
SELECT dep_month,
dep_day_of_week,
dep_date,
COUNT(*) AS flight_count
FROM flights
GROUP BY 1,2,3
) a
GROUP BY 1,2
ORDER BY 1,2;


#2

After the closed parenthesis you have an ‘a’ ("…GROUP BY 1,2,3
) a"), and it is used as a title for the table.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.