Jump to content


Photo

Select * LIKE 'something'


  • Please log in to reply
1 reply to this topic

#1 ego0

ego0
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 30 January 2006 - 04:00 PM

I have a book about SQL 'SQL for Dummies' to be specific and I have found the keywords 'LIKE' and 'NOT LIKE' and I was wondering if this can be used in MYSQL syntax? (Need to know for usage in PHP script)

#2 fenway

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

Posted 30 January 2006 - 07:24 PM

Sure... SELECT * FROM yourTable WHERE yourField LIKE 'j%' will retrieve anything that starts with a 'j'. Note that if you start with a wildcard, you won't be able to use an index.
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