Search a MySQL column with a JSON string for a specific value
<p>I currently have a MySQL table that contains a column to store category ids. These ids are stored in a JSON string. I am looking for the most efficient method to query these JSON string for a specific id. </p>

<p><strong>For example:</strong></p>

<p><strong>Table:</strong> <em>posts</em></p>

<p><strong>Field:</strong> <em>cats</em></p>

<p>Here are some example values for the JSON string in the <em>cats</em> column:</p>

<hr>

<p>[111, 123, 456]</p>

<p>[123, 345, 999]</p>

<p>[555, 777, 888]</p>

<p>Let's say I want to query for all rows that contain the id: "123" within the JSON string. I know I can accomplish this using a series of <strong>LIKE</strong> comparisons but I'm sure there is a more efficient way to query the JSON strings. Any other ideas would be much appreciated.</p>

<p>Thanks!</p>