If you have an item in both tables that is the same, which I guess you do,
you could try this:

Lets use Lot_Id

SELECT Fields
FROM Table
WHERE Cond1
AND Lot_ID IN
(SELECT Fields
FROM Table
Where Cond2)

Larry Juncker
Senior Cold Fusion Developer
Heartland Communications Group, Inc.
[EMAIL PROTECTED]

-----Original Message-----
From: Ken Monroe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 01, 2001 9:47 AM
To: CF-Talk
Subject: Re: Concatenate 2 Queries


The problem I'm having if I use a UNION is that the queries use 2 different
WHERE clauses.  What  I need to do is:

SELECT Fields
FROM Table
WHERE Cond1
UNION
SELECT Fields
FROM Table
Where Cond2

My understanding is I can only use the WHERE clause after the last SELECT
block...

----- Original Message -----
From: "Philip Arnold - ASP" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, August 01, 2001 10:38 AM
Subject: RE: Concatenate 2 Queries


> > Is there a way to combine (concatenate) 2 different queries
> > *without* using
> > the QueryNew, QueryAddRow, QuerySetCell stuff?  Something like
> > QueryCat(Query1, Query2). ??
>
> I'm not sure if Query a Query does this, but how about using UNION?
>
> Philip Arnold
> Director
> Certified ColdFusion Developer
> ASP Multimedia Limited
> T: +44 (0)20 8680 1133
>
> "Websites for the real world"
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> **********************************************************************
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to