Oracle: SQL query that returns rows with only numeric values

前端 未结 6 531
抹茶落季
抹茶落季 2020-12-12 17:21

I have a field (column in Oracle) called X that has values like \"a1b2c3\", \"abc\", \"1ab\", \"123\", \"156\"

how do I write an sql query that returns me only the X

6条回答
  •  余生分开走
    2020-12-12 17:54

    The complete list of the regexp_like and other regexp functions in Oracle 11.1:

    http://66.221.222.85/reference/regexp.html

    In your example:

    SELECT X
    FROM test
    WHERE REGEXP_LIKE(X, '^[[:digit:]]$');
    

提交回复
热议问题