Created
October 12, 2022 21:58
-
-
Save J2112O/1cb9b6b35c72c6529ee7bbb67ba7072f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT t.id, t.start_segment, t.end_segment, | |
SUM(t.one_lag) OVER(ORDER BY t.id ASC) AS rolling_sum | |
FROM | |
(SELECT | |
id, start_segment, end_segment, | |
LAG(segment_length, 1) OVER(ORDER BY id ASC) AS one_lag | |
FROM coords_measure) AS t; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment