Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • I've used both CTEs as well as temp/variable tables. What would be the benefit of using a CTE over the latter two? Commented May 12, 2014 at 19:36
  • 8
    @Jared Using CTEs keeps the code readable because you don't need to define a temp table and it's column types and by using cte you even get an intellisense for the column type and name even you didn't specified them. Commented Aug 21, 2014 at 8:22
  • 10
    Recursion is one benefit that needs a mention. Commented Oct 3, 2015 at 17:29
  • 3
    Mysql 8 supports CTE Commented Aug 27, 2018 at 16:40
  • So mysql now also gets syntactic candy. Commented Jan 17, 2019 at 17:42