甲骨文,从一个字符串中提取多个子字符串

时间:2018-09-16 20:59:19

标签: sql regex string oracle substring

尝试从字符串下方提取两个数值(8和10)作为两个新列。

试图从when I scroll my navbar text which should not be translucent in my navbar how can I solve this problem? for more details, see the picture below 问题的答案中受益,但无法解决这个问题。

任何帮助表示赞赏!

'{"someInconsiderableText1": {"answer": "8", "question": "someInconsiderableText2"}, "someInconsiderableText3": {"answer": "10", "question": "someInconsiderableText4"}}'

1 个答案:

答案 0 :(得分:1)

有什么帮助吗?

SQL> with test (col) as
  2    (select '{"someInconsiderableText1": {"answer": "8", "question": "someInconsiderableText2"},
"someInconsiderableText3": {"answer": "10", "question": "someInconsiderableText4"}}'
  3     from dual
  4    )
  5  select replace(regexp_substr(col, '"\d+"', 1, 1), '"') first,
  6         replace(regexp_substr(col, '"\d+"', 1, 2), '"') second
  7  from test;

FIRST      SECOND
---------- ----------
8          10

SQL>