I have table which include 2 column: title and param, the values are like the following:
-title: Teaching
-params:
{ "ufield926":"34",
"ufield927":"Sud",
"ufield928":"Ara",
"ufield929":"Mecca",
"ufield930":"1\/1\/1983",
"ufield933":"011",
"ufield934":"Mub",
"ufield943":"SU\/HI\/14",
"ufield944":"Average",
"ufield946":"Female"
}
I want to extract the code after "ufield943": which is SU/HI/14 only and concatenate it with the value in title column to be like the following:
--> Teaching (SU/HI/14)
Here is the query I tryingI have tried:
update tbl set title = CONCAT_WS(title,' ', '(' , (select *, substring( params, locate('ufield943', params) + 12, locate('ufield944', params) - locate('ufield943', params) - 15 )),')') from tbl;
I get the following error "ERR_PARSE_ERROR" every time I run the code.