Subject Re: [firebird-support] Re: intersect operation
Author Jacqui Caren
Nigel Weeks wrote:
> Students majoring in math AND CS:
> select Student
> from MajorsIN
> where Major = 'math' AND Major = 'CS'

I am confused - is this a Firebird specific SQL trick that I missed?
FWICS the where clause should always fail - giving an empty result set.

One (messy) solution would be (assuming Student is a lone IA)

select A.Student
from MajorsIN A,
MajorsIN B
where
A.Student = B.Student
and A.Major = 'math'
and B.Major = 'CS'

or use more explicit joins.

Jacqui