我正在尝试从SMS消息文本中提取一些信息。我在一栏中有短信。 SMS消息文本的示例来自。
我只想从此列中提取金额信息。在上述示例中,我只想提取金额,然后再提取NPR。
请提出建议
答案 0 :(得分:1)
您可以尝试以下操作:尽管它仅在这种情况下和以下字符串有效:
select substring('Your account 18715240300738 has been credited by NPR 20,784.00 on Apr 4 2016 1:30PM REF: BH691241S6807782849 Thank you',
charINDEX('NPR','Your account 18715240300738 has been credited by NPR 20,784.00 on Apr 4 2016 1:30PM REF: BH691241S6807782849 Thank you')+4,10)