有些记录如下
ABC32443
3424/334
33444现在想只取出不含字母的记录如
3424/334
33444该如何写select ?

解决方案 »

  1.   

    select * from table1 where not regexp_like(col1, '[a-zA-Z]');
      

  2.   


    with tmp as
    (
    select 'ABC32443' col1 from dual union all
    select '3424/334' col1 from dual union all
    select '33444' col1 from dual)
    select * from tmp
    where not regexp_like(col1, '[a-z]','i');COL1        
    ------------
    3424/334    
    33444  
      

  3.   

    SQL> select 1 from dual where not regexp_like('32443','[a-z]','i');
     
             1
    ----------
             1
     
    SQL> select 1 from dual where not regexp_like('32443a','[a-z]','i');
     
             1
    ----------
     
    SQL> 
      

  4.   


    SQL> with tb as
      2  (select 'ABC32443' bm from dual union all
      3  select '3424/334' from dual union all
      4  select '33444' from dual )
      5  select bm from  tb where not regexp_like(bm,'[[:alpha:]]')
      6  /BM
    --------
    3424/334
    33444
      

  5.   


    select * from  table_name where not regexp_like(col_name,'[[:alpha:]]')