Join the Stack Overflow Community
Stack Overflow is a community of 6.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

How would I find address records the do not contain a digit followed by a space? (eg., 15SMith St. as opposed to 15 Smith St)

WHERE a.address not like '.[0-9] .'

is clearly not working for me.

share|improve this question
1  
What about WHERE a.address NOT SIMILAR TO '%[0-9] %'? – Wiktor Stribiżew 2 days ago
    
Perfect! Thank You! – Tony Hendrix 2 days ago
up vote 2 down vote accepted

You may use SIMILAR TO with NOT and a pattern that is a "a curious cross between LIKE notation and common regular expression notation". It supports [0-9]:

A bracket expression [...] specifies a character class, just as in POSIX regular expressions.

So, you may use

WHERE a.address NOT SIMILAR TO '%[0-9] %'

Here, % matches any number of any chars, [0-9] matches any digits, a space matches a space and then % again matches any number of any chars. These % are necessary because SIMILAR TO requires a full string match, same as LIKE.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.