Loading

Oracle sql 子字符串长度判断

Oracle sql 子字符串长度判断

 

select t.* from   d_table t 
WHERE  substr(t.col,1,1)='8'   and instr(t.col,'/')>0 
and length(substr(t.col,1,instr(t.col,'/')))>5;

 字符串的前两位都是数字:

select * from   d_table t 
WHERE regexp_like(substr(t.col,1,2), '^[[:digit:]]+$') and length(t.col) > 7 ;

 

posted @ 2018-01-02 14:06  stono  阅读(10745)  评论(0编辑  收藏  举报