本帖最后由 gbys 于 2012-03-07 15:36:07 编辑

解决方案 »

  1.   


    Select gonghao
    FROM employee
    Where REGEXP_LIKE(gonghao, '^([a-z|0-9|A-Z]+)$')
      

  2.   

    或者给你的表加一个约束:
    alter table 你的表名 add constraint check_fr_gthr_cd check
    (regexp_replace(regexp_replace(要Check的列名, '\d'), '[A-Za-z]') is null);
      

  3.   

    regexp_replace(REGEXP_LIKE(gonghao, '^([a-z|0-9|A-Z]+)$'),0) 按穷人大仙的理论这个应该就是了。!!
      

  4.   


    select gonghao 
    from employee      gonghao 
    --------------
    1 3874
    2 adsf
    3 1001
    4 1002
    5 afd*%12
    6 asd1
    7 #24^&--查询包涵 除数字字母外的 其他字符的字段
    Select gonghao
    FROM employee
    Where not REGEXP_LIKE(gonghao, '^([a-z|0-9|A-Z]+)$')      gonghao 
    --------------
    1 afd*%12
    2 #24^&
      

  5.   


    Select gonghao
    FROM employee
    Where not REGEXP_LIKE(gonghao, '^([a-z|0-9|A-Z|-]+)$')