方法
JSON_CONTAINS(target, candidate[, path]) value MEMBER OF(json_array)
查询示例
mysql> set @list = JSON_ARRAY(1, 2); Query OK, 0 rows affected (0.01 sec) mysql> select 1 MEMBER OF(@list); +--------------------+ | 1 MEMBER OF(@list) | +--------------------+ | 1 | +--------------------+ 1 row in set (0.00 sec) mysql> SELECT JSON_CONTAINS(@list, '1'); +---------------------------+ | JSON_CONTAINS(@list, '1') | +---------------------------+ | 1 | +---------------------------+ 1 row in set (0.01 sec)