MySQL - 如何找到 JSON 中出现的次数?

MySQL - How to find number of occurance in JSON?

我关注table -

+-----+-----------+--------------------------------------+
| id  | client_id | service_values                       |
+-----+-----------+------------+-------------------------+
| 100 |      1000 | {"1": "60", "2": "64", "3": "92"}    |
| 101 |      1000 | {"1": "66", "2": "64", "3": "92"}    |
| 102 |      1000 | {"1": "70", "2": "64", "3": "92"}    |
| 103 |      1001 | {"1": "60", "2": "54", "3": "92"}    |
| 104 |      1001 | {"1": "90", "2": "64", "3": "92"}    |
| 105 |      1002 | {"1": "80", "2": "64", "3": "92"}    |
+-----+-----------+--------------------------------------+

我需要获取 service_values,其中 2 个或更多值小于 65。例如,从上述记录中,预期结果将是 -

    +-----+-----------+--------------------------------------+
    | id  | client_id | service_values                       |
    +-----+-----------+------------+-------------------------+
    | 100 |      1000 | {"1": "60", "2": "64", "3": "92"}    |
    | 103 |      1001 | {"1": "60", "2": "54", "3": "92"}    |
    +-----+-----------+--------------------------------------+

我找到了很多但找不到任何东西来在 JSON 数据中执行聚合函数。

更新 - 我试过类似的东西但没成功 -

SELECT JSON_UNQUOTE(JSON_EXTRACT(service_values,'$.1')) AS A1, JSON_UNQUOTE(JSON_EXTRACT(service_values,'$.2')) AS A2, JSON_UNQUOTE(JSON_EXTRACT(service_values,'$.3')) AS A3 FROM service_data HAVING A1 < 65 OR A2 < 65 OR A3 < 65
SELECT *
FROM test
WHERE (JSON_UNQUOTE(JSON_EXTRACT(service_values, "$.1")) < 65) 
     +(JSON_UNQUOTE(JSON_EXTRACT(service_values, "$.2")) < 65) 
     +(JSON_UNQUOTE(JSON_EXTRACT(service_values, "$.3")) < 65) >= 2;

https://dbfiddle.uk/?rdbms=mariadb_10.4&fiddle=ea41cb428cbe356c9f98a99f59ca37dc