Subject RE: [firebird-support] Re: intersect operation
Author Nigel Weeks
> I'm looking for a way to get records that exists in two separate
> lists (not necessarily tables). For example if I have 2 sql queries
> as such:
>
> (select Student
> from MajorsIn
> where Major='math')
>
> (select Student
> from MajorsIn
> where Major='CS')
>
> how to generate a list of the students majoring in both math and CS?

So the following weren't suitable?

Students majoring in math OR CS:
select Student
from MajorsIn
where Major IN ('math','CS');

Students majoring in math OF CS (alternative method):
select Student
from MajorsIN
where Major = 'math' OR Major = 'CS'

Students majoring in math AND CS:
select Student
from MajorsIN
where Major = 'math' AND Major = 'CS'

Nige.