我有tbl,其中包括2列:title和params,其值如下:
标题: {“教学”}
参数:
{“ ufield926”:“ 34”, “ ufield927”:“ Sud”, “ ufield928”:“ Ara”, “ ufield929”:“麦加”, “ ufield930”:“ 1983年1月1日”, “ ufield933”:“ 011”, “ ufield934”:“ Mub”, “ ufield943”:“ SU / HI / 14”, “ ufield944”:“平均”, “ ufield946”:“女” } 我想提取“ ufield943”之后的代码:仅SU / HI / 14,并将其与title列中的值连接起来,如下所示:
->教学(SU / HI / 14)
这是我尝试过的查询:
SELECT CONCAT(title, "(", (select
substring(
params,
locate('ufield943', params) + 12,
locate('ufield944', params) - locate('ufield943', params) - 21
) FROM tbl), ")") AS title
FROM tbl;
每次运行查询时都会出现以下错误
“#1242-子查询返回多于1行”