1、精确匹配json中的某个key的value
select ip from tab where
JSON_CONTAINS(networks,JSON_OBJECT('IP地址',#{ip}))
2、先获取josn中的key,然后按照特订符号截取
update tab set ip = SUBSTRING_INDEX((SUBSTRING_INDEX(JSON_KEYS(ip), '["', -1)),'"]',1) where ip like '%{%'
1、精确匹配json中的某个key的value
select ip from tab where
JSON_CONTAINS(networks,JSON_OBJECT('IP地址',#{ip}))
2、先获取josn中的key,然后按照特订符号截取
update tab set ip = SUBSTRING_INDEX((SUBSTRING_INDEX(JSON_KEYS(ip), '["', -1)),'"]',1) where ip like '%{%'