在 MySQL 服务器版本 8 上执行 MySQL 查询时出错

Error while executing MySQL queries on MySQL server version 8

我正在尝试在 MySQL 服务器上执行查询,但它抛出了以下错误。它在 MySQL 服务器 5.1 上运行良好,但现在我使用的是 8.0

查询

SELECT group1s.group_id, group1s.customer_id
 FROM icm_b_instance_group1s as group1s inner join icm_b_instance_groups 
as groups on group1s.group_id = groups.group_id
 where group1s.is_active = 'Y' and groups.is_active = 'Y';

[Code: 1064, SQL State: 42000] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups on group1s.group_id = groups.group_id' at line 2

来自MySQL 8.0 Keywords and Reserved Words

GROUPS (R); added in 8.0.2 (reserved)

因此您用作别名的groups是一个保留字,不能在8.0.2+版本中使用