我有这个查询,显然它有问题? 我想加入fices
与mems
,所以我可以有ficeID
以及mems
(这些查询单独工作)的所有结果。我究竟做错了什么?在数据库中测试时查询错误SQL
SELECT *
FROM mems
WHERE deleted <> -1
ORDER BY sort_mems
LEFT JOIN SELECT ficeID
FROM fices
结果:
#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 'LEFT JOIN SELECT ficeID FROM offices LIMIT 0, 30' at line 1
'Join'语句应该总是位于'where'子句之前,'from'之后 –