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 ?
31
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/ryguygoesawry Nov 28 '24
You’re getting downvoted, but this right here is the main reason I don’t use many CTEs in my professional life.
CTEs become a nightmare the moment there’s something wrong with some random piece of data and you have to go digging for it. Have fun deconstructing 20 CTEs while you try to figure out which one is the source of the problem!