Is there a way to count elements of a JSON column in MySQL? : <p>I have the table <code>answers</code> below corresponding to every new survey submission.</p>

<p><a href="https://i.stack.imgur.com/LuZZw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LuZZw.png" alt="enter image description here"></a></p>

<p>I would like to get the results as:</p>

<pre><code>| rst_id | school_id | q_4_1 | q_4_2 | ... | q_4_43 |
+--------+-----------+-------+-------+-----+--------+
|      9 |       101 |     3 |     0 | ... |      3 |
</code></pre>

<p>Is this even possible in MySQL 5.8?</p>

<p>Same question: <a href="https://stackoverflow.com/questions/51464696/count-occurrences-of-items-in-a-mysql-json-field">Count occurrences of items in a MySQL JSON field</a></p>
