check if “it's a number” function in Oracle

后端 未结 16 2804
一整个雨季
一整个雨季 2020-11-28 10:31

I\'m trying to check if a value from a column in an oracle (10g) query is a number in order to compare it. Something like:

select case when ( is_number(myTab         


        
16条回答
  •  醉话见心
    2020-11-28 11:01

    This is my query to find all those that are NOT number :

    Select myVarcharField
    From myTable
    where not REGEXP_LIKE(myVarcharField, '^(-)?\d+(\.\d+)?$', '')
    and not REGEXP_LIKE(myVarcharField, '^(-)?\d+(\,\d+)?$', '');
    

    In my field I've . and , decimal numbers sadly so had to take that into account, else you only need one of the restriction.

提交回复
热议问题