我一直在搞這個一段時間,似乎無法弄清楚如何將以下代碼從INTERSECT形式(不受MySQL支持)轉換爲INNER JOIN形式。MySQL INTERSECT替換內部連接 - 請解釋
如果有人可以將以下代碼轉換爲INNER JOIN,我想我可以從示例中理解。提前致謝!
(SELECT Student.SSN, First_Name, Last_Name
FROM Student, Enrolls
WHERE Enrolls.SSN = Student.SSN AND CourseNo='CSC132')
INTERSECT
(SELECT Student.SSN, First_Name, Last_Name
FROM Student, Enrolls
WHERE Enrolls.SSN = Student.SSN AND CourseNo='CSC134');
更標準的方法,但速度更快! – 2011-04-26 20:24:59