【发布时间】:2018-05-31 15:55:55
【问题描述】:
我正在使用 Laravel 5.5 我添加了这个依赖项来制作简单的搜索引擎
https://github.com/nicolaslopezj/searchable
但是当我尝试搜索任何东西时遇到问题
SQLSTATE[42000]: Syntax error or access violation: 1055 'myreview.movies.name' isn't in GROUP BY (SQL: select count() as aggregate from (select movies., max((case when LOWER(movies.name) LIKE car then 150 else 0 end) + (case when LOWER(movies.name) LIKE car% then 50 else 0 end) + (case when LOWER(movies.name) LIKE %car% then 10 else 0 end) + (case when LOWER(movies.description) LIKE car then 150 else 0 end) + (case when LOWER(movies.description) LIKE car% then 50 else 0 end)
我已经尝试过更改 mysql 数据库 我在更改为 mysql 5.7 后使用 mariadb 10.2 工作正常
但我的 cpanel 服务器上有 mariadb
帮我看看这个 谢谢
【问题讨论】:
-
您没有给出实际的 SQL 语句,但通常您会尝试使用保留字作为字段名。 stackoverflow.com/questions/4544051/…
-
喜欢这个? SQLSTATE[42000]: 语法错误或访问冲突: 1055 'myreview.movies.name' 不在 GROUP BY 中(SQL: select count() as aggregate from (select
movies., max ((当 LOWER(movies.name) LIKE car then 150 else 0 end) + (case when LOWER(movies.name) LIKE car% then 50 else 0 end) + (case when LOWER (movies.name) LIKE %car% then 10 else 0 end) + (case when LOWER(movies.description) LIKE car then 150 else 0 end) + (case when LOWER(movies.description) LIKE car% then 50 else 0 end) -
"'myreview.movies.name' is not in GROUP BY " 告诉你所有你需要知道的如何修复错误,即电影和名字之间应该有一个点吗?跨度>
-
您的查询中确实存在语法错误:
[...]aggregate from (select movies., max([...]。在movies后面的点之后缺少一个列名。
标签: php mysql laravel laravel-5.5