一个表有个字段是字符型的,现在要能找出这个字段不能转换成数字型的记录
比如:A字段
123
456
78a要个语句查出这个78a,就是这个表的这个字段不能转换成数字的记录。数字 字符

解决方案 »

  1.   

    select * from tablename where regexp_like(value,'^[^[:digit:]]+$');
      

  2.   

    select * from fzq where not regexp_like(value,'^[[:digit:]]+$');
      

  3.   

    with test as (
    select '123' as str from dual
    union all
    select '45622' as str from dual
    union all
    select '78a' as str from dual
    )
    SELECT * FROM TEST WHERE TRIM(TRANSLATE(STR,'0123456789','          ')) IS NOT NULL
      

  4.   

    select * from tb where patindex('%[^0-9]%',rtrim(字段A))>0
      

  5.   


    select v
      from tt
     where regexp_like(v, '^[0-9]+$')--数字开头,数字结束
       and regexp_instr(v, '[0-9]+', 1, 2) = 0;--只含一个数字 子串
      

  6.   

    用oracle的正则表达式,匹配出不是纯数字的记录就好了。
    select 字段 from 表名
    where not regexp_like(字段,'^[[:digit:]]+$');