I've looked through several similar topics on stackoverflow that is similar my question but I did not find anything that can help me yet. I have this SQL query:
SELECT * FROM twitter_result
WHERE LOWER(TweetComment) LIKE LOWER('%lebron james%')
AND LOWER(TweetComment) LIKE LOWER('%NBA%')
LeBron James Donates $41 Million To Send 1,100 Kids To College, Becomes 6th Most Charitable Athlete NBA In World
If you plan to use a
select * from twitter_result where --ignore tweets that contain #lebron james and #nba TweetComment not regexp '.*#lebron james.*|.*#nba.*' --select only those tweets that contain lebron james AND nba and TweetComment regexp '[[:<:]]lebron james[[:>:]]' and TweetComment regexp '[[:<:]]nba[[:>:]]'
All the patterns being searched for, have to be stated explicitly as MySQL by default doesn't support lookarounds.
The above match is case insensitive by default. Use
regexp binary if the search needs to be case sensitive. Add more search words as needed.