select count(*)
 from table
where substr(wbs,1,1)='1'
and wbs<>'1'

解决方案 »

  1.   

    select count(1) from t
     where wbs > '1' and wbs < '2';
      

  2.   

    select count(*) from table where instr(wbs,'.')>0
      

  3.   

    select count(*) from table where instr(billcd,'1.')>0;
      

  4.   

    create function get_count(p_wbs in varchar2)
    return number
    as
    num number:=0;
    cursor t_sor is
    select wbs from tab1 where substr(wbs,1,1)=substr(p_wbs,1,1);
    begin
    for v_sor in t_sor loop
    if instr(v_sor.wbs,p_wbs)>0 then
    num:=num+1;
    end if;
    end loop;
    return num;
    end;
    /
    select get_count(wbs) from tab1;