这是我的SQL查询。有没有办法在单个“ SELECT QUERY,UPDATE QUERY”中运行它?
表格数据:-
+++++++++++++ 列名 ++++++++++++++++
{“家庭”:[“ a”,“ b”,“ c”]}
++++++++++++++++++++++++++++++++++++
{“家庭”:[“ d”,“ e”,“ f”]}
++++++++++++++++++++++++++++++++++++++++
{“家庭”:[“ b”,“ e”,“ f”]}
++++++++++++++++++++++++++++++++++++
SELECT JSON_REPLACE(columnname, JSON_SEARCH(columnname, 'one', 'a'), "{'a': 1}") FROM tablename;
UPDATE tablename
SET columnname= JSON_REPLACE(columnname, JSON_SEARCH(columnname, 'one', 'a'), '{"a": 1}')
WHERE product_id != id;