title: Is there any way to run mysql json function in another function?
body: <p>This is my SQL query. Is there any way to run it in a single "SELECT QUERY,UPDATE QUERY"?</p>
  
  <p>table data :- </p>
  
  <p>+++++++++++++
  columnname
  ++++++++++++++</p>
  
  <p>{"family": ["a", "b", "c"]}</p>
  
  <p>++++++++++++++++++++++++++++++++++</p>
  
  <p>{"family": ["d", "e", "f"]}</p>
  
  <p>+++++++++++++++++++++++++++++++++++++++</p>
  
  <p>{"family": ["b", "e", "f"]}</p>
  
  <p>++++++++++++++++++++++++++++++++++</p>
  
  <pre><code>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;
  </code></pre>