Jump to content


% or _ in the WHERE variable LIKE clause

  • Please log in to reply
1 reply to this topic

#1 essjay_d12

  • Members
  • PipPipPip
  • Advanced Member
  • 121 posts

Posted 23 April 2006 - 03:04 PM

What does % do in the WHERE something LIKE clause and what are the others I can use, is there a full list that would be accessible to me?



#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 23 April 2006 - 05:53 PM

This is a wildcard character that matches any number of characters. There's also the underscore (_), which matches a single characters. These let you find anothing that starts with 'q', or is a two-letter word starting with 'a', etc. Kind of like * and . in Perl regexs. Speaking of which, you can also match on regexs... the refman has a laundry list of the ones available. Just remember that indexes get become totally useless when you use these, so use with caution.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users