【发布时间】:2023-01-20 15:54:36
【问题描述】:
帮助获得输出为 2000,其中输入值为 2000/100
我想要整个字符串 /
input 2000/100
output 2000
【问题讨论】:
帮助获得输出为 2000,其中输入值为 2000/100
我想要整个字符串 /
input 2000/100
output 2000
【问题讨论】:
两个简单的选项(根据您的描述):
SQL> with test (col) as
2 (select '2000/100' from dual)
3 select col,
4 regexp_substr(col, 'w+') option_1,
5 substr(col, 1, instr(col, '/') - 1) option_2
6 from test;
COL OPTION_1 OPTION_2
-------- -------- --------
2000/100 2000 2000
SQL>
【讨论】: