View Single Post
  #2  
Old September 13th, 2005, 07:20 PM
MGFoster
external usenet poster
 
Posts: n/a
Default

TomHinkle wrote:
Can Anybody tell me what performs better in a where clause looking for
several text strings:

Method 1:
Like "Example_A" or like "Example_B"

Method 2:
In ("Example_A","Example_B")


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Those examples mean different things. If Method 1 was like this

column_name = "Example_A" or column_name = "Example_B"

then it would be the same as method 2. Since you don't have any
wildcard characters in your example you should be using the equal sign
instead of the Like comparison operator.

When using the equal sign in method 1 they both perform the same. The
JET optimizer translates method 2 into method 1 when the query runs.
--
MGFoster:::mgf00 at earthlink decimal-point net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQycYbIechKqOuFEgEQJtcQCgwqtgURROBQb3o3WOGKMC0l I1b/MAoIj8
yjgTEmTewUbaRM265T4DqvYI
=dMQz
-----END PGP SIGNATURE-----