How can I identify the datas that have anything else than a number in them in a where clause ?
SELECT *
FROM <table>
WHERE REGEXP_LIKE(<column>, '[^[:digit:]]');
Hope it helps...
You can also use the TRANSLATE function to do this, as follows:
SELECT *
FROM A_TABLE a
WHERE LENGTH(TRANSLATE(a.FIELD, 'x0123456789', 'x')) IS NOT NULL
The expression LENGTH(TRANSLATE(a.FIELD, 'x0123456789', 'x'))
will return NULL if the field contains only numeric characters. If non-numeric characters are present it will return the number of non-numeric characters.
Share and enjoy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With