SELECT stuff REGEXP 'itunes' as is_itunes;
In this MySQL query, if "stuff" has the word "itunes" in it, it will mark it as itunes.
However, I want to say "begin with". How can I check for "begin with" instead of anywhere in the text?
SELECT ... WHERE stuff LIKE 'itunes%';
Here %
serves as a wildcard character, so this would match rows with the stuff
field equal to any of itunes
, itunesfoo
, itunes1
, ...
More info: SQL LIKE Operator at W3Schools.
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