我需要从表的列中包含的数据字符串中提取的数字。
字符串示例:
<strong>Customer Name</strong>: Hit - julaifnaf afbafbaf Caraballo Pichardo vs PICHARDO ALBERTO<br />
<strong>Address</strong>: NA - abdcinfainaf 42982542542 vs xx<br />
<strong>Country of citizenship</strong>: NA<br />
<strong>Country of residency</strong>: NA<br />
<strong>Date of birth</strong>: NA - xx vs Nov-72<br />
<strong>Place of birth</strong>: NA<br />
<strong>Identification Number</strong>: **1**<br />
<strong>emailDetails</strong>: <br/>
<b>Subject: </b>abcdejnfanfa <br/>
<b>Sent To: </b>[email protected]<br/>
在上面的示例字符串中,我需要提取的数字1
。st的长度和记录的位置各不相同,但是要提取的数字始终在Identification Number</strong>:
之前和之后<br /><strong>
。
我可以使用什么功能来提取这些数据?
SELECT TO_NUMBER(
REGEXP_SUBSTR(
column_name,
'<strong>Identification Number</strong>:.*?(\d+).*?<br />',
1,
1,
NULL,
1
)
) AS id_number
FROM table_name;
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句