Horje

PostgreSQL - Recursive queries
Start
  Sum of Integers
WITH RECURSIVE t(n) AS (
    VALUES (1)
  UNION ALL
    SELECT n+1 FROM t WHERE n < 100
)
SELECT sum(n) FROM t;

Link to Documentation (opens new window)


Read Article
https://develop.horje.com/learn/1434/reference