假设字符串中确实有一个数字,则可以使用
patindex():
select left(s, patindex('%[^0-9]%', s) - 1)from (select substring(col, patindex('%[0-9]%', col), len(col)) as s from t ) t;
假设字符串中确实有一个数字,则可以使用
patindex():
select left(s, patindex('%[^0-9]%', s) - 1)from (select substring(col, patindex('%[0-9]%', col), len(col)) as s from t ) t;