Regular expressions inside SQL Server

前端 未结 5 1125
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-08 14:34

I have stored values in my database that look like 5XXXXXX, where X can be any digit. In other words, I need to match incoming SQL query strings li

5条回答
  •  广开言路
    2020-12-08 15:15

    In order to match a digit, you can use [0-9].

    So you could use 5[0-9][0-9][0-9][0-9][0-9][0-9] and [0-9][0-9][0-9][0-9]7[0-9][0-9][0-9]. I do this a lot for zip codes.

提交回复
热议问题