CTE Support #245
-
|
I was wondering if CTE (Common Table Expressions) are supported? I have a query that's running fine locally (MySQL 8.0.27) but the same query fails on PlanetScale. 1105 unknown error: syntax error at position 5 near 'with'. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
|
@ljmclaney No, I'm afraid. Vitess does not support window functions or common table expressions yet. We're actively working on closing the compatibility gap, but I cannot say if or when we're going to get to CTE at this time. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! Double checking if you have an ETA to support CTE/rCTE ? |
Beta Was this translation helpful? Give feedback.
-
|
Hi, any updates for supporting CTE here? |
Beta Was this translation helpful? Give feedback.
-
|
As of early 2025, the current update for this question is that essentially all branches should be on a Vitess 21 or newer build which has support for both the non-recursive CTE support added within Vitess 19 together with the experimental support for recursive CTEs that arrived in Vitess 21: |
Beta Was this translation helpful? Give feedback.
-
|
Hi @orware Is this enabled by default? I'm encountering an error when using a CTE in a DELETE statement: |
Beta Was this translation helpful? Give feedback.
As of early 2025, the current update for this question is that essentially all branches should be on a Vitess 21 or newer build which has support for both the non-recursive CTE support added within Vitess 19 together with the experimental support for recursive CTEs that arrived in Vitess 21:
https://vitess.io/blog/2024-03-06-announcing-vitess-19/#query-compatibility-enhancements
https://vitess.io/blog/2024-10-29-announcing-vitess-21/#recursive-common-table-expressions-ctes