【发布时间】:2016-12-27 11:00:16
【问题描述】:
这个错误是在将整个源代码移动到 5.3 版本后出现的,我现在已经摸不着头脑了。
所以我有这样一个雄辩的查询:
POI::select('*', DB::raw("SQRT( POW((x - {$this->x}),2) + POW((y - {$this->y}),2) ) AS distance"))
->where('status', Config::get('app.poi_state.enabled'))
->whereNotIn('id', $excludePOIList)
->having('distance', '<=', $distance)
->orderBy('distance')->get();
它在升级之前发现它现在抛出:
语法错误或访问冲突:1463 非分组字段“距离” 在 HAVING 子句中使用 (SQL: select *, SQRT( POW((x - 860.0000),2) + POW((y - 105.0000),2) ) AS distance from
poiwherestatus= 1 and @987654324 @ not in (1) 有distancedistance asc)
我想检查我的服务器上是否启用了 ONLY_FULL_GROUP_BY 模式,但它没有...
选择@@sql_mode NO_ENGINE_SUBSTITUTION
相同的查询在 MySQL 工作台中运行良好。 怎么回事?
【问题讨论】: