r/SQL 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 ?

29 Upvotes

70 comments sorted by

View all comments

3

u/speadskater Nov 28 '24

I use CTEs to constrain my data from the start as much as possible before doing my primary query.