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'));