How can I determine if a string is numeric in SQL?

前端 未结 7 1611
难免孤独
难免孤独 2020-12-03 17:51

In a SQL query on Oracle 10g, I need to determine whether a string is numeric or not. How can I do this?

7条回答
  •  执念已碎
    2020-12-03 18:00

    You can use REGEXP_LIKE:

    SELECT 1 FROM DUAL
    WHERE REGEXP_LIKE('23.9', '^\d+(\.\d+)?$', '') 
    

提交回复
热议问题