|  | Posted by Good Man on 06/22/07 19:10 
Derrick Shields <derrick.shields@gmail.com> wrote innews:1182537069.716376.120720@k79g2000hse.googlegroups.com:
 
 > So here is my question.  What is the difference between LIKE 'value'
 > and LIKE '%VALUE%'? When you add the percentage signs, I understand
 > the percentage signs are wild cards, but if you're using LIKE without
 > wildcard percentage signs, is that technically the same as saying
 > "="?
 
 sort of... but in cases where you're doing the LIKE on columns with more
 than one word in it.. ie:
 
 value 1 = "the north pole"
 value 2 = "the south pole"
 
 ....
 "SELECT * FROM Locations WHERE Place LIKE 'pole'"  would return nothing,
 but "LIKE '%pole'" would return both...
 
 or, alternatively:
 
 value 1 = "johnny"
 value 2 = "john"
 value 3 = "johnson"
 
 "SELECT * FROM tableName WHERE DudesName LIKE 'john'"  would return only
 the 2nd value, but "LIKE '%john'" would return all three...
  Navigation: [Reply to this message] |