title: How to search JSON data in MySQL?
body: <p>I have inserted records in mysql DB, with <code>json encoded</code> data type, Now I have to make search within <code>json encoded</code> data, but i am not able to get proper data using following MySql query.</p>
  
  <pre><code>SELECT  `id` ,  `attribs_json` 
  FROM  `products` 
  WHERE  `attribs_json` REGEXP  '&quot;1&quot;:{&quot;value&quot;:[^&quot;3&quot;$]'
  </code></pre>
  <p>Query results are key equal to &quot;1&quot; and value is anything except &quot;3&quot;</p>
  <p>My data is:</p>
  <pre><code>{&quot;feature&quot;:{&quot;1&quot;:{&quot;value&quot;:&quot;[&quot;2&quot;,&quot;3&quot;]&quot;},
              &quot;2&quot;:{&quot;value&quot;:[&quot;1&quot;]},
              &quot;5&quot;:{&quot;value&quot;:&quot;&quot;},
              &quot;3&quot;:{&quot;value&quot;:[&quot;1&quot;]},
              &quot;9&quot;:{&quot;value&quot;:&quot;&quot;},
              &quot;4&quot;:{&quot;value&quot;:&quot;\u0633\u0627\u062a\u0646&quot;},
              &quot;6&quot;:{&quot;value&quot;:&quot;&quot;},
              &quot;7&quot;:{&quot;value&quot;:&quot;&quot;},
              &quot;8&quot;:{&quot;value&quot;:&quot;&quot;}
             },
  &quot;show_counter&quot;:&quot;0&quot;,
  &quot;show_counter_discount&quot;:&quot;&quot;
  }}
  </code></pre>