下面2句SQL,我都知道是什么意思,一个用的是exists,一个用的是in.
可我就是不理解为什么exists用在这里,就可以呢?
select Student.* from Student , SC where Student.S# = SC.S# and SC.C# = '01' and
exists (Select 1 from SC SC_2 where SC_2.S# = SC.S# and SC_2.C# = '02') order by Student.S#
select Student.* from Student , SC where Student.S# = SC.S# and SC.C# = '01' and
Student.S# in (Select S# from SC SC_2 where SC_2.S# = SC.S# and SC_2.C# = '02') order by Student.S#