日期:2014-05-16  浏览次数:20718 次

mysql中求交集的问题,在线等~~
SELECT memno, fname, lname
FROM member
WHERE memno IN
(SELECT borrowermemno
FROM book
WHERE callnumber IN
(SELECT callnumber
FROM title
WHERE name = 'Iliad'))
INTERSECT
SELECT memno, fname, lname
FROM member
WHERE memno IN
(SELECT borrowermemno
FROM book
WHERE callnumber IN
(SELECT callnumber
FROM title
WHERE name = 'Odyssey'));


请问这个在mysql中要怎么实现?似乎INTERSECT不能用。

------解决方案--------------------
SELECT memno, fname, lname
FROM member
WHERE memno IN
(SELECT borrowermemno
FROM book
WHERE callnumber IN
(SELECT callnumber
FROM title
WHERE name = 'Iliad'))
and memno IN
(SELECT borrowermemno
FROM book
WHERE callnumber IN
(SELECT callnumber
FROM title
WHERE name = 'Odyssey'));