1 怎么截取这个字符/前的字母
B258/10
B1/89
我希望得到B258 B1
 
2 有这么一排数据
title   callno   bookrecno
论语 B222/3
论语 B222/3
论语 B222/3
孙子兵法 B222/4
孙子兵法 B222/4
孙子兵法 B222/4
百家姓 B222/5
百家姓 B222/5
百家姓 B222/5
大学中庸 B222/6
大学中庸 B222/6
大学中庸 B222/6想更新右边1行数据 按照s_order排序得到结果:
title   callno   bookrecno
论语 B222/3 1
论语 B222/3 1
论语 B222/3 1
孙子兵法 B222/4 2
孙子兵法 B222/4 2
孙子兵法 B222/4 2
百家姓 B222/5 3
百家姓 B222/5 3
百家姓 B222/5 3
大学中庸 B222/6 4
大学中庸 B222/6 4
大学中庸 B222/6 4

解决方案 »

  1.   

    1
    select substr('B258/10',1,instr('B258/10','/')-1)||' '||substr('B1/89',1,instr('B1/89','/')-1) from dual;2
      

  2.   

    因为数据量很大
    我想根据num类型来update
    用varchar更新很慢
    而且是title那么多字符 就更慢了
      

  3.   

    Q1:
    with test1 as (
    select 'B258/10' as str from dual
    union all
    select 'B1/89' as str from dual
    )
    select regexp_substr(str,'[^/]+') from test1Q2:
    update tablename set bookrecno = (select dense_rank()over(order by callno) as rn from tablename)
      

  4.   

    第2个提示ora-01427:单行子查询返回多行