I'm trying to only select the data with numbers in them (the table looks like this):
eteee 231
wrgrr
test 1
bioo 21
wee
with the query: SELECT address1 FROM ps_address WHERE address1 not like '%[^0-9]%';
but i get all the values right back.
I'm trying to only select the data with numbers in them (the table looks like this):
eteee 231
wrgrr
test 1
bioo 21
wee
with the query: SELECT address1 FROM ps_address WHERE address1 not like '%[^0-9]%';
but i get all the values right back.
You can simply write:
SELECT address1 FROM ps_address WHERE address1 like '%[0-9]%';
this will work :
SELECT address1 FROM ps_address WHERE regexp_like(address1,'.*[0-9]+.*');
Try this REGEXP
:
SELECT address1 FROM ps_address WHERE address1 REGEXP '[[:digit:]]';
This returns the rows containing digits anywhere inside address1
.