1
我有3个表:无法加入两个以上的表
table1
fields : id, title, cat1_id
table2
fields : id, title, cat2_id
table3
fields : id, title
我的SQL:
SELECT a.id, a.title, b.title, c.title
FROM table1 AS a
INNER JOIN table2 AS b ON b.id = a.cat1_id
AND INNER JOIN table3 AS c ON c.id = b.cat2_id
ORDER BY a.id DESC
它不工作。
我试试这个SQL,它的工作:
SELECT a.id, a.title, b.title, c.title
FROM table1 AS a
INNER JOIN table2 AS b ON b.id = a.cat1_id
ORDER BY a.id DESC
但双INNER JOIN
不起作用。
我寻找答案了几个小时,只是有点**“和” **感谢您的帮助。 :) –