SELECT title,name FROM Lessons,Users WHERE Lessons.author = Users.email;
SELECT title,name FROM Lessons JOIN Users ON Lessons.author = Users.email;
和
SELECT title,name FROM Lessons INNER JOIN Users ON Lessons.author = Users.email;
教訓有一個名爲author
索引爲外鍵的列Users.email
。 title
是Lessons
和name
一列是Users
我相信這是這個問題的解決:http://stackoverflow.com/questions/894490/sql-left-join-vs-multiple-tables-on-from-line – jzila
的區別僅僅是風格, – onedaywhen