这个mysql查询有什么问题..?

时间:2016-03-17 11:25:52

标签: mysql

SELECT `a`.`aID` INNER JOIN `a` ON `a`.`aID` = `b`.`aID` FROM `b` WHERE 1;

**ERROR 1064** - 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 'INNER JOIN `a` ON `a`.`aID`  at 
line 1 

3 个答案:

答案 0 :(得分:0)

来自子句缪斯来自加入声明。

其中1 也没有意义。它显示所有细节 尝试

SELECT 
    a.aID
FROM
    b
        INNER JOIN
    a ON a.aID = b.aID;

答案 1 :(得分:0)

你写错了语法。

试试这个

SELECT a.aID 
FROM a 
INNER JOIN b ON a.aID = b.aID;

答案 2 :(得分:0)

您的整个查询错误,您应该尝试这样

SELECT a.aId FROM a INNER JOIN b ON a.aID=b.aID WHERE 1;