Subject RE: [firebird-support] Re: intersect operation
Author Chris Donges
(select Student
from MajorsIn
where Major in('math','CS'))

> -----Original Message-----
> From: vbj34 [mailto:vbj34@...]
> Sent: Thursday, 22 July 2004 9:41 AM
> To: firebird-support@yahoogroups.com
> Subject: [firebird-support] Re: intersect operation
>
>
> 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?
>
> --- In firebird-support@yahoogroups.com, Svein Erling Tysvær
> <svein.erling.tysvaer@k...> wrote:
> > --- In firebird-support@yahoogroups.com, "vbj34" <vbj34@y...> wrote:
> > > Hi, is it possible to perform set intersect operation with
> Firebird
> > > SQL? Thanks.
> >
> > Is this a difficult way to ask whether it is possible to return
> only
> > records that exists in two separate tables? If so, it is simply a
> > matter of doing
> >
> > SELECT <something>
> > FROM <table1>
> > JOIN <table2> ON <table2.field1> = <table1.field1>
> >
> > or (depending on what you want)
> >
> > SELECT <something>
> > FROM <table1>
> > WHERE EXISTS(SELECT * FROM <table2> WHERE <table2.field1> = <table1.
> > field1>)
> >
> > If this is not what you are asking, please rephrase your question
> so
> > that it is easier for us to understand.
> >
> > HTH,
> > Set
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Yahoo! Domains - Claim yours for only $14.70
> http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/67folB/TM
> --------------------------------------------------------------
> ------~->
>
>
> Yahoo! Groups Links
>
>
>
>
>
>