简体   繁体   English

使用phpmyadmin的mySQL的INNER JOIN语法

[英]INNER JOIN syntax for mySQL using phpmyadmin

SELECT Question.userid, user.uid
FROM `question`
WHERE NOT `userid`=2
LIMIT 0, 60
INNER JOIN `user`
ON `question`.userid=`user`.uid
ORDER BY `question`.userid

returns Error: 返回错误:

You have an error in your SQL syntax; 您的SQL语法有错误; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN User ON question .userid= user .uid ORDER BY question .userid' at line 5 查看与您的MySQL服务器版本对应的手册,以便在'INNER JOIN User ON question .userid = user .uid ORDER BY question .userid'附近使用正确的语法

Can't for the life of me figure out what I'm doing wrong here. 不能为我的生活弄清楚我在这里做错了什么。

Your query doesn't look valid. 您的查询看起来不合法。 You may want to try the following: 您可能想尝试以下方法:

SELECT      `question`.userid, `user`.uid
FROM        `question`
INNER JOIN  `user` ON `question`.userid = `user`.uid
WHERE       `userid` <> 2
ORDER BY    `question`.userid
LIMIT       0, 60

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM