你先用substr判断第一个字符,看是“津”还是“开“;然后再order by就可以了

解决方案 »

  1.   

    就是使用substr,instr函数的问题。
    效率肯定不好。
      

  2.   

    order by substr(col,...),substr(col,...)
      

  3.   

    select * from  table1 order by REPLACE(YourColumn,'津开发','1'),trim('号',trim('开发',trim('开发',TRIM ('津' FROM YourColumn))))
      

  4.   

    写成两条独立的查询,用 union all 合并不是更快吗, 还可以利用到index
    select * from tab where col like '津开发%' order by col
    union all
    select * from tab where col like '开发%' order by col
      

  5.   

    我上面只是举个例子,其实还有好多开头为2个字或者是3个字类型的文件了,而且请大家注意如果简单用substr的话,是不是顺序会是这样1,10,11,12……19,2,20,但是我要1,2,3,4,……10,11
      

  6.   

    受不了。
    select * from table order by substr(col,instr(col,']'))
      

  7.   

    “津开发[2003]2号”要保证数字后只有一个"号"的字符.用以下方法看是否可帮到你
    create function getlength(a in varchar2)
    return number
    as
    num number;
    begin
    num:=lengthb(substr(a,instr(a,']')+1))-2;
    return num;
    end;
    /select ... from table_name group by substr(col_id,1,instr(col_id,'[')-1),substr(col_id,instr(col_id,']',1,2)+1,get(col_id));