dolt icon indicating copy to clipboard operation
dolt copied to clipboard

order of CTEs defined matters

Open jycor opened this issue 2 years ago • 0 comments

In MySQL, CTEs that reference other CTEs can only see the ones to the left

mysql> with c as (select * from b), b as (select * from a), a as (select 1) select * from c;
ERROR: 1146: Table 'test_db.b' doesn't exist

dolt has no such restriction

dolt > with c as (select * from b), b as (select * from a), a as (select 1) select * from c;
+---+
| 1 |
+---+
| 1 |
+---+

jycor avatar Aug 30 '22 17:08 jycor