patindex
... 感谢Larnu提供的样本数据
WITH VTE AS(
SELECT *
FROM (VALUES('ABC COLLA #1'),
('SF6 DINGS'),
('MEMORY NO. 2'),
('MEMORY NO1, TATA'),
('ABC PIKUS NO 2'),
('39A NY ROAD, S/F''DOK'),
('CHINA/ PPS#494030750'),
('KIKU /769-0133')) V([col1]))
select *
from VTE
where (
PATINDEX('%[0-9]%',col1) > 0 --1 numeric
or PATINDEX('%[0-9]%',SUBSTRING(col1,PATINDEX('%[0-9]%',col1),999)) > 0 --two numberics
)
and
PATINDEX('%[0-9]%',SUBSTRING(col1,PATINDEX('%[0-9]%',col1) + PATINDEX('%[0-9]%',SUBSTRING(col1,PATINDEX('%[0-9]%',col1),999)) + 1,999)) = 0 --3 numerics or more