我无法在Laravel 5.3中运行这个简单的查询
$top_performers = DB::table('pom_votes')
->groupBy('performer_id')
->get();
Run Code Online (Sandbox Code Playgroud)
它给了我:
SQLSTATE[42000]: Syntax error or access violation: 1055 'assessment_system.pom_votes.id' isn't in GROUP BY (SQL: select * from `pom_votes` group by `performer_id`)
Run Code Online (Sandbox Code Playgroud)
但是,如果我从错误中复制原始查询并直接在PhpMyAdmin中触发,它可以正常工作.
我已经检查了这个:
https://laravel.com/docs/5.3/queries#ordering-grouping-limit-and-offset
任何帮助将是appricaited.
谢谢,
Parth Vora