Skip to content

Instantly share code, notes, and snippets.

@J2112O
Created October 12, 2022 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save J2112O/be4b4a71fd9ae3d30646e04d7753ccaa to your computer and use it in GitHub Desktop.
Save J2112O/be4b4a71fd9ae3d30646e04d7753ccaa to your computer and use it in GitHub Desktop.
SELECT
id, start_segment, end_segment,
SUM(LAG(segment_length, 1) OVER(ORDER BY id ASC)) OVER(ORDER BY id ASC) AS one_lag
FROM coords_measure;
Error Code: 3593. You cannot use the window function 'lag' in this context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment