Boss: busiest hour, local
Combine time zones, grouping and DISTINCT ON: per customer time zone find the local hour with the most orders.
task
For each customer tz, the local hour with the most orders (ties: earlier hour). Return tz, hour, count.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
Combine time zones, grouping and DISTINCT ON: per customer time zone find the local hour with the most orders.
For each customer tz, the local hour with the most orders (ties: earlier hour). Return tz, hour, count.