oracle--数据筛选

一:当统一社会信用代码或者工商注册号两个字段中,有的时候只有一个字段含有数据,但是所取的值必须要拥有字段,这个时候,语句为下:

select t.entname,
       case
         when t.uniscid is null then
          t.regno
         else
          t.uniscid
       end as 编码或注册号,

  from REG_MarPriPInfo t



case when 当该字段为空的时候 then 取另外一个字段 else 取当前字段 end

二:筛选某个字段中不带中文的所有数据

select * from table where regexp_substr(check,'[0-9]+') is not null   
可以筛选出不带中文

select * from 表名where regexp_substr(所选字段,'[0-9]+') is not null  

 

posted @ 2018-11-14 10:03  迷途的小码农  阅读(1681)  评论(0编辑  收藏  举报