开发者

Select where has pattern in text column. sql server 2005

开发者 https://www.devze.com 2023-01-10 22:36 出处:网络
Hi I\'m sure this is possible but am not sure how to go about it. In this case I want to find records that have text similar to this pattern \'123-1234\'

Hi I'm sure this is possible but am not sure how to go about it. In this case I want to find records that have text similar to this pattern '123-1234'

SEL开发者_StackOverflow中文版ECT FROM TABLE WHERE COLUMN = 'HAS pattern 3 numbers+ - + 4numbers'

I think the numbers are post codes perhaps. Still bit of an sql noob. Any helpers appreciated.


Assuming the phone number is anywhere in the column:

SELECT FROM TABLE WHERE COLUMN LIKE '%[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]%'
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号