+-----------+-------+------+------+-------+
-- 查询计算机系年龄不大于19岁的学,计算机系的学生与年龄不大于19岁的学生取交集,MySQL不支持INTERSECT操作
SELECT * FROM student WHERE sdept='cs'
INTERSECT
SELECT * FROM student WHERE sage<=19
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'INTERSECT
SELECT * FROM student WHERE sage<=19' at line 2
-- 用内连接代替
SELECT a.* FROM student AS a INNER JOIN student AS b ON a.sno=b.sno
WHERE a.sdept='CS' AND b.sage<=19
+-----------+-------+------+------+-------+
(北联网教程,专业提供视频软件下载)
……