Jump to content

"OR" im trying to find a field which has a or b or c in it


Recommended Posts

Im trying to look in a single field for theoccurance of one of three strings..looking at an operator page on mysql.com i see that to get [b]or[/b] you just use a space so
[code]
....WHERE virtualName='stringone stringtwo stringthree'
[/code]

I would like to get a hit if the field contains either "stringone" or "stringtwo" or "stringthree"

thanks for any help.

mojito
Actually, IMHO, an IN clause is "easier":

[code]WHERE virtualName IN ( 'stringone', 'stringtwo', 'stringthree' )[/code]

Not to mention that it makes the conversion from an array trivial... plus I'm sure the optimizer has less work to do.
[!--quoteo(post=387154:date=Jun 23 2006, 09:37 AM:name=cmgmyr)--][div class=\'quotetop\']QUOTE(cmgmyr @ Jun 23 2006, 09:37 AM) [snapback]387154[/snapback][/div][div class=\'quotemain\'][!--quotec--]
O cool...didn't know you could do that.
What do you know...you learn something new every day!
[/quote]
I wish that was actually true.... [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.