Posted inSQL
Anders Swanson
3 years ago
support nested WITH statements (i.e. nesting of SELECT statements with WITH clauses inside of a CTE)
The query below does not work in any TSQL-db. But it does on every other database today that I can think of.
```
-- does not work
WITH goku_outer AS (
WITH goku_inner AS (
SELECT 9001 as power_level
)
SELECT * FROM goku_inner
)
SELECT * FROM goku_outer
```
Allowing nested WITH statements (not in love with terminology, examples given below) would enable MSFT customers to fully take advantage of templating engines and their respective ecosystems. These templating engines are already very popular on non-MSFT database products. For a longer description please see this link
https://dbt-msft.github.io/dbt-msft-docs/docs/nested_CTES/
New
ProgrammabilitySuggestionsNew
Vote
2 Comments