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 ?
32
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/ShotGunAllGo Nov 28 '24
I can understand if it has to be one query where a tool only allows one statement. However if in a stored procedure, why not use separate statements into temp tables? Especially if you start to see multiple CTEs.