I am trying to write a select statement that uses several keywords to search by. For example
SELECT id FROM my_mod mm WHERE (mm.name LIKE '%joe%' OR mm.name LIKE '%jim%');
What I would like to do is in the return data have a extra column that counts the number of times that row matches one of the like statements.
So for the one above if there is a name jimjoe it would have a count of 2 or if the name is jim it would have a count of 1. Does anyone know of a way to do this?
I should also mention that I can’t use temp tables.
Try this
I check here how it works