I’m looking to do a simple comparison test in MySQL, I have a field that stores ID’s like so:
1;2;23;12
Or if only one option was selected when creating that entry it would only be one:
2
At any rate I am looking to filter my select query to find entries in the DB that have for instance the ID 2 in them. So I need some sort of comparison to compare that id 2 against that column with those values and a possible single value.
You are looking for find_in_set function:
I would recommend to you to normalize database (see: http://en.wikipedia.org/wiki/First_normal_form)
Also, notice to you that this kind of queries don’t has high performance.