1。嵌套查询:
select A.S# from Sc as A, Student as B
where B.Sdept = ‘本系’
and A.S# = B.S#
and (select count(*) from Sc where S# = A.S#) >= 3
order by A.S#
2。连接查询:
select A.S# from Sc as A left join Student as B
on A.S# = B.S#
where B.Sdept = ‘本系’
and (select count(*) from Sc where S# = A.S#) >= 3
order by A.S#