这样的查询:
SELECT
*
FROM
r_user_group
JOIN groups ON groups.id = r_user_group.group_id
在本地执行没有任何问题,腾讯云 MYSQL 是 8.0 版本
SELECT
*
FROM
r_user_group
JOIN groups ON groups.id = r_user_group.group_id
在本地执行没有任何问题,腾讯云 MYSQL 是 8.0 版本
|
F281M6Dh8DXpD1g2May 27, 2021
1
这是要白嫖 debug 么
盲猜你两个表里面有名字一样的字段 |
|
itechifyMay 27, 2021
2
佛了,报什么错也补贴一下?
是不是两个表字符集不一致? |
|
raaaaaarMay 27, 2021 via Android
3
报错呢
|
|
4
结贴了。问题找出来了!
表名不能用 groups,至于原因,腾讯客服也没说为什么 |
|
5
工作中最烦某人发个消息,xx 系统不能用了,然后啥信息也没有。
简直想上去抽他。 |
|
6
表字段没有任何问题,mysql 报错信息:ERROR 1064 (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 groups.id = r_user_group.group_id' at line 1
直接 select * from groups;也不行 |
|
7
|
|
swullingMay 27, 2021 via iPhone
9
说正经的,groups 在 mysql 8 是保留字
https://dev.mysql.com/doc/refman/8.0/en/keywords.html#keywords-8-0-detailed-G |
|
swullingMay 27, 2021 via iPhone
10
保留字如果要使用必须加反引号括起来。
|
|
basefasMay 27, 2021
11
groups 是 MySQL 8.0 的关键字,要用的话需要加 ` ` 包裹一下,这个问题 MySQL 工具一般会提示出来
|