How can I check if the value is numeric? I tried is numeric but it is returning an error that the function is not found.
Example:
select *isnumeric*("abc") // returns 0 or false
select *isnumeric*("123") // returns 1 or true
How can I check if the value is numeric? I tried is numeric but it is returning an error that the function is not found.
Example:
select *isnumeric*("abc") // returns 0 or false
select *isnumeric*("123") // returns 1 or true
A reasonable method is to look for non-digits:
select (case when str like '%[^0-9]%' then 0 else 1 end)
This looks for strings of digits. You can extend it to support negative signs, decimal points, and exponential representation if those are needed.