Not sure how to explain this. I have the following sample table
id participants
13 128, 125
18 122, 125
29 182, 125
34 17, 12
38 18, 15
I want to get a count of the messages where 12 is on the right so am using the following query, select count(id) as messages from table where locate (12, participants, 2) The problem with this query is that it returns all results with 12 e.g. 125, so instead of having one count i have 4 counts which is incorrect. Any suggestions on what query to use?