Sorry made a mistake and sent before I was done last time
That should have read.
<cfquery name="myQuery" datasource="foo">
SELECT field_a
FROM table
WHERE field_a NOT IN (SELECT field_b FROM table)
</cfquery>
<cfoutput query="myQuery">
This is bad = #field_a#<br>
</cfoutput>
The only prob with this is when either field has thousands of entries.
--K
> -----Original Message-----
> From: Chapman, Katrina
> Sent: Thursday, September 14, 2000 1:56 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: Comparing values in 2 queries
>
>
> You're right this can be done with a simple query
>
> <cfquery name="myQuery" datasource="foo">
> SELECT field_a
> FROM table
> WHERE field_a NOT IN (SELECT field_b FROM table)
> </cfquery>
> <cfoutput query="myQuery">
> This is bad = #field_a#
>
> > -----Original Message-----
> > From: Bud [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, September 14, 2000 3:57 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Comparing values in 2 queries
> >
> >
> > On 9/14/00, Roger Lim penned:
> > >Hi,
> > >
> > >Wanna ask for help here. Let's say that I have 2 queries
> which have a
> > >similar field column name. I wish to do a comparision and
> it's a AND
> > >critieria.
> > >
> > >For example,
> > >
> > >Field_a Field_b
> > >1 1
> > >2 2
> > >3 4
> > > 5
> > >
> > >I wish to compare field_a with field_b and everything that's
> > in field_a has
> > >to be found in field_b, else it'll fail. How do I go about
> > doing that ?
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.