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:
SELECT start_terminal,
duration_seconds,
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
FROM tutorial.dc_bikeshare_q1_2012
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
The case against SQL formatting
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:
SELECT start_terminal,
duration_seconds,
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
FROM tutorial.dc_bikeshare_q1_2012
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