小编整理“计算机考研数据库知识点:嵌套查询”相关内容,一起来看。
IN引出的子查询
SELECt Sno,Sname FROM Students WHERe Sex = '女' AND Speciality IN (
SELECt Speciality FROM Students WHERe Sname ='王丽丽'
);
集合的比较引出的子查询
SELECt Sno,Sname,Speciality,Birthday FROM Students WHERe Speciality<>'软件工程' AND Birthday >ALL(
SELECt Birthday FROM Students WHERe Speciality = '软件工程'
);
存在量词引出的子查询
SELECt Sno,Sname FROM Students S WHERe EXISTS (
SELECt * FROM SC WHERe Sno=S.Sno AND Cno = 'CS403');