SELECT a.data
FROM Authentications a, Authentications b
LEFT JOIN Authentications c ON a.id = c.id
为什么这个查询会产生"#1054 - 'on clause'中的未知列'a.id'"
SELECT a.data
FROM Authentications a
LEFT JOIN Authentications c ON a.id = c.id
没关系?
问题是您正在混合JOIN语法,因此您使用的别名在ON条件中不可用.你不应该混合JOIN语法.
您的查询应该是:
SELECT a.data
FROM Authentications a
CROSS JOIN Authentications b
LEFT JOIN Authentications c
ON a.id = c.id
Run Code Online (Sandbox Code Playgroud)
或者,如果您正在加入b,那么您将使用:
SELECT a.data
FROM Authentications a
INNER JOIN Authentications b
on a.id = b.id
LEFT JOIN Authentications c
ON a.id = c.id
Run Code Online (Sandbox Code Playgroud)
它JOIN具有比逗号更高的优先级,因此别名a不可用于ON.
| 归档时间: |
|
| 查看次数: |
78 次 |
| 最近记录: |