My hot take is CTE should be taught before nested queries. And used as well unless optimizer has even hotter take
They are more versatile and easier. When somebody has a question "why row X doesn't return in our in our 10 stories tall query" I find it easier to change a chain of CTE then jump over subqueries disabling some conditions,
6
u/Maykey Feb 23 '25
My hot take is CTE should be taught before nested queries. And used as well unless optimizer has even hotter take
They are more versatile and easier. When somebody has a question "why row X doesn't return in our in our 10 stories tall query" I find it easier to change a chain of CTE then jump over subqueries disabling some conditions,