{"suit":"8","line":"10,"card":"5"} ,这种字符串,想把里面的数字拆出来求和用,请问应该怎么拆呀?
先用replace把"替换掉,怎么取:后的三个数字呢?求各位大佬帮解答,谢谢
{"suit":"8","line":"10,"card":"5"} ,这种字符串,想把里面的数字拆出来求和用,请问应该怎么拆呀?
先用replace把"替换掉,怎么取:后的三个数字呢?求各位大佬帮解答,谢谢
如下:
select a+b+c from (
select
(select substring_index(SUBSTRING_INDEX('{"suit":"8","line":"10","card":"5"}','"',4),'"',-1) from dual) a,
(select substring_index(SUBSTRING_INDEX('{"suit":"8","line":"10","card":"5"}','"',8),'"',-1) from dual) b,
(select substring_index(SUBSTRING_INDEX('{"suit":"8","line":"10","card":"5"}','"',12),'"',-1) from dual) c
from dual
) x