select sum(decode(sign(substr(to_char(code),1,3)-135),-1,1,0)) 小于135,
sum(decode(sign(substr(to_char(code),1,3)-135),-1,0,1)) 大于等于135 
from yourtable

解决方案 »

  1.   

    或者:
    select 
    (select count(*) from yourtable where substr(code,1,3)<135) 小于135,
    (select count(*) from yourtable where substr(code,1,3)>=135) 大于等于135 
    from dual;
      

  2.   

    select count(*) from yourtable 
    where to_number(substr(code,1,3))<135
    or to_number(substr(code,1,3))>=135
      

  3.   

    select 
    (select count(*) from yourtable where substr(code,1,3)<135) 小于135,
    (select count(*) from yourtable where substr(code,1,3)>=135) 大于等于135 
    from dual;
      

  4.   

    select sum(decode(sign(substr(code,1,3)-135),-1,1)) 少于135,sum(decode(sign(substr(code,1,3)-135),1,1)) 大于135 from tabname;