CTE / WITH + alias

Playground: https://drizzle.run/zb932yr9sv2w1nzn916wzvdt How can i generate the same SQL code (left join "bar" as cte1) without
sql`${cte} as cte1`
sql`${cte} as cte1`
6 Replies
outranker
outranker•3mo ago
i think you can use table aliases?
function
functionOP•2mo ago
for some reason, that link just redirects me to just https://drizzle.run/ D: so i can't see the code you wrote and i've checked out table aliases but as far as i can tell you can't use them for CTEs. šŸ‘€
TOSL
TOSL•2mo ago
You have to enable shared playgrounds That's why you can't see it
function
functionOP•2mo ago
you mean @outranker, right?
TOSL
TOSL•2mo ago
Yea

Did you find this page helpful?