View Single Post
Old 11-28-2012, 05:57 AM   PM User | #7
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,248
Thanks: 59
Thanked 3,999 Times in 3,968 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
If what you are trying to do is exclude all 3 of those states you *MUST* do it thus:

Code:
( ua LIKE '%spider%' || NOT ( state LIKE 'Florida' || state LIKE 'Maine' || state LIKE 'New York' ) )
*** HOWEVER ***

You should *NEVER* use LIKE (or NOT LIKE) unless you have wild card characters (e.g., % character[s]) in the string being checked.

So you *REALLY* should code that as:
Code:
( ua LIKE '%spider%' || NOT ( state = 'Florida' || state = 'Maine' || state =  'New York' ) )
Except NOW you can collapse that down to the simpler and more efficient
Code:
( ua LIKE '%spider%' || state NOT IN ( 'Florida','Maine','New York' ) )
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote