I want to execute a query on a database to select all rows in the 'Event' table where the 'about' section has any of the following words in it: strokestown, arts, day. My query, shown below is only getting rows that have the first word, strokestown in them. How do I make it search for all words?
SELECT *
FROM Event
WHERE about LIKE 'strokestown%'
OR about LIKE 'arts%'
OR about LIKE 'day%';
Thank you for your time!!
Jim
Place the wildcard character, '%', at the start as well as the end of the your search terms:
SELECT *
FROM Event
WHERE about LIKE '%strokestown%'
OR about LIKE '%arts%'
OR about LIKE '%day%';
SELECT * FROM Event
WHERE about LIKE '%strokestown%'
OR about LIKE '%arts%'
OR about LIKE '%day%'
Put a % before and after the keywords.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With