mysql sql_mode=only_full_group_by研读
MySQL 5.7.5后only_full_group_by成为sql_mode的默认选项之一,这可能导致一些sql语句失效。
比如下表game:
id | group_id | name | score |
---|---|---|---|
1 | A | 小刚 | 20 |
2 | B | 小明 | 19 |
3 | B | 小花 | 17 |
4 | C | 小红 | 18 |
执行sql:
select name, group_id from game group by group_id
(记为sql_make_group) …
近期评论