oralce数据里有非法字符,包括空格以及其他符号等,如何查出来,请求高人指点

解决方案 »

  1.   

    用translate函数,把非法的字符替换为‘#’,就可以通过#来查询出特殊字符了。
      

  2.   

    正则过滤 查询包涵 除数字字母外的 其他字符
    with t as
    (
         select 'a&**' c1 from dual union all
         select 'bbbb' c1 from dual union all
         select '  . d' c1 from dual union all
         select '1234' c1 from dual union all
         select '98sd8f' c1 from dual union all
         select '98/d8f' c1 from dual union all
         select '(sd)' c1 from dual 
    )select c1
    from t
    where not regexp_like(c1,'^[A-Za-z0-9]+$')     c1
    ----------------------
    1 a&**
    2   . d
    3 98/d8f
    4 (sd)