所以我在 MySQL (10.3.15-MariaDB-1:10.3.15+maria~bionic) 上得到了 JSON 和 Choice 列
这是 JSON =
{"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6}
选择是键的一半,例如 04 / 17 / 08 / 12 等。
我已经尝试过这个:
SELECT JSON_EXTRACT('{"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6}','$.08:13');
返回 8,它工作正常,但我只有 13 的值......
所以
SELECT JSON_EXTRACT('{"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13":8,"09:12":7,"10:11":6}','$.13');
然后它将返回 null 因为未找到密钥。
有没有像“LIKE”这样的搜索键使用?已经尝试 $.%13% 或 $%.13% {"04:17":62,"05:16":31,"06:15":18,"07:14":12,"08:13 ":8,"09:12":7,"10:11":6} 喜欢 '%13%'