I am trying to use a where clause with like on a column. However I need it to use a subquery to search against multiple phrases.
This question is similar to MySQL LIKE IN()?
Right now my query looks like this.
WHERE hashtag REGEXP 'indiana|iu|bloomington'
However I need to do a subquery where the string is so my query would be something like this
WHERE hashtag REGEXP (select name from hashtags where hid = 1)
The above line obviously doesn't work and I'm not sure if REGEXP would be best in this situation. Is there a way to use LIKE or REGEXP against multiple strings using a subquery? Perhaps there is a better way to do this without a subquery that I just don't see at the moment. Any help or direction is appreciated, thank you.