Skip to content

Instantly share code, notes, and snippets.

@ogiovannyoliveira
Last active April 9, 2020 14:10
Show Gist options
  • Save ogiovannyoliveira/6a945ced811f6b15e688d6a2cbc8ea36 to your computer and use it in GitHub Desktop.
Save ogiovannyoliveira/6a945ced811f6b15e688d6a2cbc8ea36 to your computer and use it in GitHub Desktop.
Consulta SQL com valor acumulativo.
SELECT
sum(sum(column)) OVER (ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as accumulated
FROM
table
WHERE id_foo = ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment