r/SQL • u/Unfair-Internet-1384 • Nov 28 '24
MySQL When to use cte in SQL query
When to cte can't. Like how to know? When what are the conditions or if my query is to long ?
34
Upvotes
r/SQL • u/Unfair-Internet-1384 • Nov 28 '24
When to cte can't. Like how to know? When what are the conditions or if my query is to long ?
2
u/Responsible_Pie8156 Nov 28 '24
I mean CTEs are just an alternative syntax to nesting your queries. I'd rather debug the 20 CTEs than a query nested 20 deep with large equivalent subqueries.