and Caller_id >'5750000' 
and caller_id < 5789999 
and Caller_id >'5970000'
and Caller_id <'5999999' 
这几个条件不能同时成立,应该写成
and (Caller_id >'5750000' 
and caller_id < 5789999 
or Caller_id >'5970000'
and Caller_id <'5999999')

解决方案 »

  1.   

    subStr()没有错
    这一段有问题:
    and Caller_id >'5750000' 
    and caller_id < 5789999 
    and Caller_id >'5970000'
    and Caller_id <'5999999'应该是:
    and ((Caller_id >'5750000' 
    and caller_id < '5789999')
    or 
    ( Caller_id >'5970000'
    and Caller_id <'5999999'))
      

  2.   

    substr(Caller_ID, 1, 2) <> '13'
    and substr(Caller_ID, 1, 1) <> '9' 
    and substr(Caller_ID, 1, 1) <> '0' 
    是没用的, 楼主,你试试这个语句!Select * from Bill_List where substr(Caller_ID, 1, 3) <>'590' 
    and ((Caller_id >'5750000' 
    and caller_id < '5789999')
    or 
    ( Caller_id >'5970000'
    and Caller_id <'5999999'))
    order by Caller_id;
      

  3.   

    Select * from Bill_List where (substr(Caller_ID, 1, 2) <> '13' 
    and substr(Caller_ID, 1, 1) <> '9' 
    and substr(Caller_ID, 1, 1) <> '0' 
    and substr(Caller_ID, 1, 3) <>'590') 
    or ((Caller_id >'5750000' and caller_id < 5789999 ) or (Caller_id >'5970000' and Caller_id <'5999999'))
    order by Caller_id;
      

  4.   

    substr(Caller_ID, 1, 2) <> '13' 
    and substr(Caller_ID, 1, 1) <> '9' 
    and substr(Caller_ID, 1, 1) <> '0' 
    and substr(Caller_ID, 1, 3) <>'590' 
    是没有错的,错的是以下:
    and Caller_id >'5750000' 
    and caller_id < 5789999 
    and Caller_id >'5970000'
    and Caller_id <'5999999'
    zhangshunshi(宇轩)应该没有错