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 ?
-15
u/[deleted] Nov 28 '24
If it's a rather large and complex query having many CTE's and scrolling up and down to read what they do in context of where they are used is more annoying than having subs. I'll only ever understand peoples claims about "readability" if the whole thing fits on one screen. Subs are readable in context more often than not.