title: How to search JSON array in MySQL?
body: <p>Let's say I have a JSON column named <strong>data</strong> in some MySQL table, and this column is a single <em>array</em>. So, for example, data may contain:</p>
  
  <blockquote>
    <p>[1,2,3,4,5]</p>
  </blockquote>
  
  <p>Now I want to select all rows which have a data column where one of its array elements is greater than 2. Is this possible?</p>
  
  <p>I tried the following, but seems it is always <em>true</em> regardless of the values in the array:</p>
  
  <pre><code>SELECT * from my_table
  WHERE JSON_EXTRACT(data, '$[*]') &gt; 2;
  </code></pre>