macromedia.coldfusion.cfml_general_discussion
[Top] [All Lists]

Re: Comparing two queries yields one result too many

Subject: Re: Comparing two queries yields one result too many
From: "cf_dev2"
Date: Thu, 23 Aug 2007 01:39:46 +0000 UTC
Newsgroups: macromedia.coldfusion.cfml_general_discussion
> Each query has two to five inner joins by itself (don't ask me, I wasn't the 
db designer). 
 > By themselves, each query takes up about fifteen lines of code

 You could always create a "view" for each statement. It would simplify the 
queries and allow you to do a simple LEFT JOIN as if each statement were a 
single table.  As mentioned a JOIN would likely be faster than a QoQ with an IN 
clause. Especially if the queries contain a large number of records.

 SELECT t1.var1, t1.var2, t1.var3, t1.var4
 FROM yourViewA t1 LEFT JOIN yourViewB t2
 ON t1.var1 = t2.var1
 WHERE t2.var1 IS NULL

 > There has *so* got to be a data issue here

 Sounds like you need to examine the data and identify out the problem.  


<Prev in Thread] Current Thread [Next in Thread>