sketchgal — 2011-01-10T16:52:51-05:00 — #1
Can anyone tell me how I would set up a query so that it will select rows based on where a column contains any one of 5 values. For example if name field contains john or mark or raymond. Sounds like it should be straight forward but I can't think how I would code that. What I use for a single option would be this:
SELECT * FROM table WHERE Name LIKE '%John%'
Thanks for any help in advance with this.
scallioxtx — 2011-01-10T16:54:47-05:00 — #2
Just keep adding them with OR in between:
SELECT * FROM table WHERE Name LIKE '%John%' OR Name LIKE "%mark%" OR Name LIKE "%raymond%"
sketchgal — 2011-01-10T17:06:19-05:00 — #3
Excellent. Thanks!! Obviously having a blonde moment!! Much appreciated.