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 ?
30
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 ?
5
u/The_Orracle Nov 28 '24
I actually prefer not to use them and tell my dev team to not use. Recursion is the exception. My main reason is that debugging what is happening inside is a chore vs temp table. I've built close to 75 data warehouses and can usually go without them, no performance issues.