SQL isnumeric DB2 1

SQL isnumeric DB2

select *      from yourtable                  
 where REGEXP_LIKE(trim(yourzone) , '^\d+$')

Here is what the above code is Doing:
1. trim(yourzone) – removes any leading or trailing spaces from the string
2. REGEXP_LIKE(trim(yourzone) , '^\d+$') – checks if the string is all digits

Similar Posts