要求如下:
表A中存在一个字段B,(varchar2型,12位,纯数字)
我想选出字段B中,以33开头,以000结束,同时6到9位不是000的行
该怎么写?
select a.b from a where a.b like '33%' and  (???)oracle数据库。
各位大大请教了。

解决方案 »

  1.   

    试试
    select B from A where substr(B,6,3)!='000' and B like '33%000'select a.b from a where a.b like '33%000' and a.b not like '33%000000'
      

  2.   

    select B from A where not substr(B,6,3)='000' and B like '33%000'
      

  3.   

    说先向周末仍然战斗在工作一线的同志们问好。
    ———————————————————————————————————
    select a.b from a where a.b like '33%000' and a.b not like '33%000000'
    __________________________________________________________________
    这个可以!
    3Q