Select where has pattern in text column. sql server 2005
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]%'
精彩评论