MySQL服务器版本,可在'varchar(200))AS行问题附近使用正确的语法

时间:2019-02-23 09:02:46

标签: mysql

mysql显示以下查询的以下问题

错误是:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'varchar(200)) AS row From #__categories Union all Select id, title' at line 3

查询:

With cte 
        As
        (Select id, title,patern_id, Cast(row_number() over (order by id) AS varchar(200)) AS row
        From #__categories

        Union all

        Select id, title,patern_id,cte.row + Cast(row_number() over (order by id) as varchar(200)) as row
        From #__categories a
        Join cte c on (a.patern_id =c.id)
        )

        Select *

        From cte
        Order by row

有人可以告诉我什么是problam吗?

mysql版本:8.0.15

php:7.3.2

0 个答案:

没有答案