Also this:
where x IN (#valuelist(anotherquery.id)#)
is simpler than this:
where
<cfloop query = "anotherquery">
x = #anotherquery.id#
<cfif anotherquery.currentrow neq
anotherquery.recordcount>
OR
</cfif>
</cfloop>
----- Original Message -----
From: "Christopher Olive, CIO" <[EMAIL PROTECTED]>
> they are essentially the same statement. the optimizer of your database
> will translate them the same. IN is "cleaner" operator to use if you have
> multiple ORs, though. makes it easier to understand your SQL statement.
>
> chris olive, cio
> cresco technologies
> [EMAIL PROTECTED]
> http://www.crescotech.com
>
>
>
> -----Original Message-----
> From: Duane Boudreau [mailto:[EMAIL PROTECTED]]
>
> Which is more efficient?
>
> WHERE x = 1 OR x = 2 OR x = 3
>
> OR
>
> WHERE x IN (1,2,3)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists