我想做类似的事情:
DELETE FROM student WHERE student.course, student.major IN (SELECT schedule.course, schedule.major FROM schedule)
但是,似乎您只能在IN运算符中使用一列。真的吗?看起来像这样的查询应该是可能的。
不,您只需要括号即可:
DELETE FROM student WHERE (student.course, student.major) IN (SELECT schedule.course, schedule.major FROM schedule)