如何在 mysql 5.7 中统计 json 数组中特定值的计数
在 mysql 5.7 中无法使用 json_table 函数统计 json 数组中特定值的计数。一种替代方法是使用 json_search 函数,如下所示:
SELECT
count( JSON_SEARCH( tags, 'one', "3467562849402896" ) ),
count( JSON_SEARCH( tags, 'one', "3467562861985809" ) ),
count( JSON_SEARCH( tags, 'one', "3465044211793921" ) )
FROM
X
XXXXXXXXX在这个查询中: