Skip to content

Instantly share code, notes, and snippets.

@choplin
Created May 19, 2011 12:38
Show Gist options
  • Save choplin/980648 to your computer and use it in GitHub Desktop.
Save choplin/980648 to your computer and use it in GitHub Desktop.
Solution of Project Euler #1 with PostgreSQL
SELECT
sum(num)
FROM
generate_series(1, 999) AS t(num)
WHERE
(num % 3) = 0
OR (num % 5) = 0
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment