In this case specifically the parenthesis should make no difference at all.
Are you sure the two queries are exactly as you've shown them?

For instance there's a BIG difference between this:

WHERE
 paID=<cfqueryparam value="#law.paid#" cfsqltype="cf_sql_integer" />
AND (nl_status = 'published' OR nl_status = 'archived')

and this:

WHERE
 paID=<cfqueryparam value="#law.paid#" cfsqltype="cf_sql_integer" />
AND nl_status = 'published' OR nl_status = 'archived'



On Mon, Oct 18, 2010 at 3:17 PM, Les Mizzell <[email protected]> wrote:

>
> What's the difference between
>
> 1. ------------------------------
> SELECT nl_id
> FROM vw_newsletters
> WHERE
>  (paID=<cfqueryparam value="#law.paid#" cfsqltype="cf_sql_integer" />)
> AND (nl_status = 'published' OR nl_status = 'archived')
>
>
> 2. ------------------------------
> SELECT nl_id
> FROM vw_newsletters
> WHERE
>  paID=<cfqueryparam value="#law.paid#" cfsqltype="cf_sql_integer" />
> AND (nl_status = 'published' OR nl_status = 'archived')
>
>
>
> #1 returns the correct records
> #2 returns nothing
>
> Not sure what difference the first set of parenthesis makes in #1
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338291
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to