I went looking for the gospel, and lost my religion.
Wow. Seems so obvious now, but it never occurred to me. I am saved!
Hey, so like, how would you handle window statements? Example below from mode.com:
LAG(duration_seconds, 1) OVER
(PARTITION BY start_terminal ORDER BY duration_seconds) AS lag,
LEAD(duration_seconds, 1) OVER
(PARTITION BY start_terminal ORDER BY duration_seconds) AS lead
WHERE start_time < '2012-01-08'
ORDER BY start_terminal, duration_seconds
Seems to meet the interpretability requirements, but the partition clause placement hurts my eyes ever so slightly