Reputation: 463
Let's say I have this table:
id post_content
How can I construct a SELECT ..... post_content LIKE %Mike% query that will only return rows with multiple occurrences of Mike? In this case, record 2 and 3.
Thank you.
Upvotes: 1
Views: 1446
Reputation: 882
You can simply do this,
SELECT * FROM `table_name` WHERE post_content LIKE '%mike%mike%'
i tested it out in MySQL, and it is working exactly as you want it to.
Upvotes: 1
Reputation: 11301
Maybe if you tried:
SELECT * FROM ... WHERE post_content LIKE '%Mike%Mike%'
This is tricky and I don't have MySQL right now to try it. I know from past experience that Oracle and MS SQL worked differently with that same approach, so you'll have to try it.
Upvotes: 3