我正在尝试与MySQL进行多次内部联接,但我一直收到以下错误
#1064 - 您的SQL语法出错;检查与MySQL服务器版本对应的手册,以获得正确的语法 靠近'on codes.code = votes.code ORDER BY date desc LIMIT 0,30'at 第2行
SELECT * FROM codes
INNER JOIN user ON codes.userid = user.gid
INNER JOIN on codes.code = votes.code
ORDER BY date desc
我这样做了吗?
答案 0 :(得分:6)
Ya错过了第二次加入中的表名:
SELECT * FROM codes
INNER JOIN user ON codes.userid = user.gid
INNER JOIN votes on codes.code = votes.code
ORDER BY date desc