Comment by bchammer

4 years ago

This looks like a turing-complete language if you add function. One benefit or current SQL is that it can (and is) often rewritten to be executed more efficiently. This requires a simpler and declarative model - far from a programming language.

If you want simple 'forward declaration' take a look at the SQL WITH clause.