我试图从中提取数字的表中有一个[Comment]
类型的列。VARCHAR(255)
这些数字将始终为 12 位数字,但通常不在同一个位置。其中一些还会有多个 12 位数字,这很好,但我只需要第一个。
我试过使用PATINDEX('%[0-9]%',[Comment])
,但我不知道如何设置 12 位数的要求。
我正在使用的数据示例如下:
Combined 4 items for $73.05 with same claim no. 123456789012 as is exceeding financial limits
Consolidated remaining amount of claim numbers, 123456789013, 123456789014, 123456789015, 123456789016 due to financial limits