SELECT
student.studentNo,
student.birthday,
class.className,
class.institute
FROM
class
INNER JOIN student ON student.classNo = class.classNo
WHERE
class.institute = '信息管理学院' AND
year(student.birthday) = 1990
UNION
SELECT
student.studentNo,
student.birthday,
class.className,
class.institute
FROM
class
INNER JOIN student ON student.classNo = class.classNo
WHERE
class.institute = '会计学院' AND
year(student.birthday) = 1991
等价于
SELECT
student.studentNo,
student.birthday,
class.className,
class.institute
FROM
class
INNER JOIN student ON student.classNo = class.classNo
WHERE
(class.institute = '信息管理学院' AND year(student.birthday) = 1990) OR (class.institute = '会计学院' AND year(student.birthday) = 1991)
ORDER BY class.institute DESC