例如,要修改ID为1至100,但是不包括ID为5、23,25,80的记录。
即只修改96条记录。这个where语句该怎样写?

解决方案 »

  1.   

    update t_name set column1='xxx' where id not in(5,23,25,80) and id<=100
      

  2.   

    WHERE ID NOT IN(5,23,25,80)
      

  3.   


    update  table 
    set xx='' where id not in(5,23,25,80) and xx<100
      

  4.   

    where id<=100 and  id not in(5,23,25,80) 
      

  5.   

    要是在100至200间,但不包括115,123,125,180这4条记录,我主要是看怎样用between,
    update table
    set area='北京'
    where code not in (115,123,125,180) and (between 100 and 200)
    这样不对,不知道咋写才对?
      

  6.   


    update   xx
    set area='北京'
    where (code  between 100 and 200)  and (code not in (115,123,125,180) )
      

  7.   

    要是在100至200间,但不包括115,123,125,180这4条记录,我主要是看怎样用between, 
    update table 
    set area='北京' 
    where code not in (115,123,125,180) and (between 100 and 200) 
    这样不对,不知道咋写才对?楼主的(between 100 and 200)  掉一CODE.