一:當統一社會信用代碼或者工商注冊號兩個字段中,有的時候只有一個字段含有數據,但是所取的值必須要擁有字段,這個時候,語句為下:
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