我的查询结构如下。
WITH cte1 AS (SELECT a, b FROM table1) SELECT * FROM cte1;
但它带有以下错误
Unrecognized statement type. (near "WITH" at position 0)
我用mysql --version
命令检查了我的MySQL版本,我的MySQL版本是mysql Ver 14.14 Distrib 5.7.25, for Linux (x86_64) using EditLine wrapper
这是“with”关键字的问题。
你能帮我解决这个问题吗?
如果需要公用表表达式,请使用MySQL版本8+或MariaDB 10.2+。