I have a VARCHAR type field that can contains both numeric (222) or alpha-number (CPO13) values.
I want to select only values that are numeric? I see in example how to choose non-numeric but I want to filter out those with letters of the alphabet?
I have a VARCHAR type field that can contains both numeric (222) or alpha-number (CPO13) values.
I want to select only values that are numeric? I see in example how to choose non-numeric but I want to filter out those with letters of the alphabet?
You can try using a Regular Expression that filters for values with both numeric and alphabetical characters . For example:
SELECT * FROM DATA WHERE FIELD REGEXP NOT '[A-z].[0-9]';
mySQL allows you to use regular expression as a filter !
This should select out for values like CPO13. If you want to practice regular expressions this is a great website to test whether you have the right regex. https://regex101.com/
Hope this helps !