papacico papacico - 4 months ago 7
MySQL Question

How to detect addresses with no number

I have a column

address
with thousands of addresses, most of them have a number but lot of addresses have no number, the addresses are like this:

- streetname 4
- streetname 8
- streetname 4/5
- streetname


how do i detect the fiels like 'streetname' having no number.
I have tryed with:

REGEXP '^-?[0-9]+$';


or isANumber() but none gives the right result

Answer

You could use:

address rlike '^[^0-9]*$'