В одну сторону, хотя с 2 ORs
не так много проблем (удалите '??' +
, чтобы пропустить значения, которые просто 1 или 2 цифры)
;with T(f) as (
select 'xxxxxxxxx' union
select 'xxxxxxxx6' union
select 'xxxxxxx66' union
select 'xxxxxx666' union
select 'xxxxx6666' union
select 'xxxxx666x' union
select '66' union
select '6' union
select ''
)
select
*
from
T
where
patindex('%[^0-9]%', reverse(right('??' + f, 3))) > 1
>>
f
6
66
xxxxxxx66
xxxxxxxx6