也许你们要捂脸了,但作为一个SQL查询新手,我有一个语法问题。有人知道怎么了吗?
SELECT * FROM company C
OUTER JOIN company_address A ON C.company_id = A.company_id
WHERE A.company_id IS NULL
字符串
给出错误:
#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
'OUTER JOIN company_address A ON C.company_id = A.company_id WHERE A.address_id
' at line 2
型
3条答案
按热度按时间rbpvctlc1#
In MySQL应该使用
LEFT OUTER JOIN
或RIGHT OUTER JOIN
。没有OUTER JOIN
。如果你需要FULL OUTER JOIN
在MySql you can useUNION
ofLEFT JOIN
andRIGHT JOIN
aydmsdu92#
试试看
字符串
gg0vcinb3#
你必须写左联接,右联接,内联接或完整的外联接,而不是只有外联接。
您的表名也有一个错误,像这样的表的字母之间不应该有空格[company C-它应该被命名为company_C]
我希望这将是工作..一切顺利!