Non-Correlated Subqueries III


#1


Is it possible that this is the solution for the problem. If correct it is much better then proposed one. Plesa share your comment am I wrong or not.



SELECT dep_month,dep_day_of_week,dep_date,
COUNT(*) AS flight_count FROM flights
WHERE dep_day_of_week = 'Friday'
GROUP BY dep_month,dep_day_of_week,dep_date; 

or if you want to truly see all flights on friday for each month use this

SELECT dep_month,dep_day_of_week,dep_date,
COUNT(*) AS flight_count FROM flights
WHERE dep_day_of_week = 'Friday'
GROUP BY dep_month;

and finally average total distance flown by day of the week and month is:

SELECT dep_month,dep_day_of_week,dep_date,distance
FROM flights
GROUP BY dep_month,dep_day_of_week;


#2

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