簡體   English   中英

在服務器上出錯並在本地主機上正常工作,Laravel CTE(鄰接)

[英]Getting error at server and working fine at localhost, Laravel CTE (Adjacency)

我在服務器上遇到錯誤,但在本地主機上工作正常。 我正在使用 laravel 鄰接列表https://github.com/staudenmeir/laravel-adjacency-list

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'recursive `laravel_cte` as ((select *, 1 as `depth`, cast(`id` as char(65535)) a' at line 1 (SQL: with recursive `laravel_cte` as ((select *, 1 as `depth`, cast(`id` as char(65535)) as `path` from `user_relations` where `user_relations`.`parent_id` = 10000 and `user_relations`.`parent_id` is not null) union all (select `user_relations`.*, `depth` + 1 as `depth`, concat(`path`, '.', `user_relations`.`id`) from `user_relations` inner join `laravel_cte` on `laravel_cte`.`id` = `user_relations`.`parent_id`)) select count(`id`) as aggregate from `laravel_cte` where `status` = 0)

請幫我解決它,我一無所知,因為我是這種復雜的 mySQL/MariaDB 開發的新手。

“CTE”( WITH RECURSIVE ... )直到 MariaDB 10.2 或 MySQL 8.0 才可用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM