当前位置:网站首页>MySQL updates JSON string in array form
MySQL updates JSON string in array form
2022-06-30 03:58:00 【CSDN Q & A】
surface A There is a field in the B The storage is in the form of an array json strand , Such as :
[
{
"id":20190926000000213,
"skuCode":"11108893",
"skuName":" Test the name 1"
},
{
"id":20190926000000214,
"skuCode":"11108892",
"skuName":" Test the name 2"
}
]
Now it needs to be updated in batches skuCode=11108892 Corresponding skuName
Known to be writable sql as follows :
update The name of the table set Field B=replace( Field B,' Test the name 2',' The official name ')
where json_contains( Field B ,json_object('skuCode','11108892'))
Above sql You can find out skucode contain 11109982 And replace the test name 2 Is the official name .
But if there are data as follows :
[
{
"id":20190926000000213,
"skuCode":"11108888",
"skuName":" Test the name 21"
},
{
"id":20190926000000214,
"skuCode":"11108892",
"skuName":" Test the name 2"
}
]
be skucode by 11108888 Of ,name It will also be replaced , Become an official name 1.
I wonder if there is any other plan
边栏推荐
猜你喜欢

云原生——Web实时通信技术之Websocket
![[punch in - Blue Bridge Cup] day 2 --- format output format, ASCII](/img/b2/0059659867e867a32b8e7cef567c8b.jpg)
[punch in - Blue Bridge Cup] day 2 --- format output format, ASCII

Thingsboard tutorial (II and III): calculating the temperature difference between two devices in a regular chain

Interface test tool postman

毕业设计EMS办公管理系统(B/S结构)+J2EE+SQLserver8.0
![[note] Introduction to data analysis on June 7, 2022](/img/8b/9119bfdd10227f5c29ca2ece192880.png)
[note] Introduction to data analysis on June 7, 2022

UML diagrams and list collections
![[punch in - Blue Bridge Cup] day 3 --- slice in reverse order list[: -1]](/img/c2/13693dcb51aab565957b6c5e686b7c.jpg)
[punch in - Blue Bridge Cup] day 3 --- slice in reverse order list[: -1]

【筆記】AB測試和方差分析

Solve the problem of Navicat connecting to the database
随机推荐
Magical Union
Day 9 script and resource management
Node-RED系列(二八):基于OPC UA节点与西门子PLC进行通讯
Simple theoretical derivation of SVM (notes)
RPC correction
[operation] MySQL query on May 24, 2022
[cloud native] AI cloud development platform - Introduction to AI model foundry (developers can experience AI training model for free)
[image fusion] multi focus and multi spectral image fusion based on cross bilateral filter and weighted average with matlab code
DBT product initial experience
Pig-Latin (UVA492)
声网自研传输层协议 AUT 的落地实践丨Dev for Dev 专栏
【模糊神经网络预测】基于模糊神经网络实现水质预测含Matlab源码
[punch in - Blue Bridge Cup] day 5 --- lower() small
【笔记】2022.5.23 MySQL
SDS understanding in redis
Product thinking - is the future of UAV express worth looking forward to?
You know AI, database and computer system
SQLyog导入数据库时报错,求帮解决!
[punch in - Blue Bridge Cup] day 2 --- format output format, ASCII
Is the largest layoff and salary cut on the internet coming?