I have data in one of my table columns as like {x:1,y:2}
. I wanted to cast the data to json like
{"x":"1","y":"2"}
I tried to use JSON_QUOTE and cast as JSON with no success.
I used this Replace section for the answer:
REPLACE(CONCAT("{\"",REPLACE(REPLACE(REPLACE(REPLACE(form_field.settings,"\n",","),"=",":") ,",","\",\""),":","\":\""),"\"}"),",\"\"","")
then I completed that Like:
JSON_EXTRACT(CAST(REPLACE(CONCAT("{\"",REPLACE(REPLACE(REPLACE(REPLACE(form_field.settings,"\n",","),"=",":") ,",","\",\""),":","\":\""),"\"}"),",\"\"","") AS JSON),"$.accessname" )