r/programming • • Nov 16 '14

PostgreSQL vs. MS SQL Server - A comparison of two relational databases from the point of view of a data analyst

http://www.pg-versus-ms.com/
171 Upvotes

321 comments sorted by

View all comments

Show parent comments

0

u/rmxz Nov 17 '14

Come back to me when you can declare a local variable in a sql script.

CTEs provide this in a Standard SQL way.

Look how this CTE uses variables Ix, Iy, Cx, Cy, X, Y, I to iterate through calculating a mandelbrot set: https://wiki.postgresql.org/wiki/Mandelbrot_set

0

u/[deleted] Nov 17 '14

[removed] — view removed comment

1

u/rmxz Nov 18 '14 edited Nov 20 '14

CTEs are turing complete - and indeed you can have as many "multiple" statements you want in the "with" clause.