【问题标题】:Finding fields with non alfa numeric valuesFinding fields with non alfa numeric values
【发布时间】:2022-12-01 18:53:00
【问题描述】:

I am looking a way to find the values in a column that has non alfa numeric values...

I tried select 'kjh$' not RLIKE '([0-9][a-z]|[A-Z])*') but does not work

Thanks for your help

【问题讨论】:

    标签: hadoop hive


    【解决方案1】:

    You can use REGEXP '^[A-Za-z0-9]+$' or RLIKE '^[A-Za-z0-9]+$'.
    Sample SQL -

    select  * from my table where mycol not RLIKE '^[A-Za-z0-9]+$' 
    

    ^ - determines start of the string
    $ - end of the string
    + - match the preceding character one or more times
    [A-Za-z0-9] - to check alphanumeric or not

    I ran a simple select statement to show output of above regex.

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-12-01
      • 2022-12-02
      • 1970-01-01
      • 2017-11-10
      • 2011-05-14
      • 2022-12-02
      • 2022-12-01
      • 1970-01-01
      相关资源
      最近更新 更多