PL/pgSQL
PL/pgSQL adds variables, loops and control flow to SQL. EXIT WHEN leaves a loop early.
task
Write s(n int): the sum 1..n, leaving the loop as soon as the total exceeds 1000.
Run a query to see rows here.
Run EXPLAIN on the statement under the cursor: Plan tab, button Explain.
No tables yet.
PL/pgSQL adds variables, loops and control flow to SQL. EXIT WHEN leaves a loop early.
Write s(n int): the sum 1..n, leaving the loop as soon as the total exceeds 1000.