保留02-02-001这笔数据,其它多删除WLBH         CSBH   CSMC 
02-02-001     001   1 
02-03-002     002    2 
02-04-001     003    3

解决方案 »

  1.   

    create table tb(WLBH varchar(20),CSBH  varchar(20),CSMC varchar(20))
    insert into tb select '02-02-001','001',1
    insert into tb select '02-03-002','002',2
    insert into tb select '02-04-001','003',3delete tb from tb t where WLBH !=(select min(WLBH) from tb)select * from tbWLBH CSBH CSMC
    02-02-001 001 1
      

  2.   

    delete from tb where wlbh!='02-02-001'
      

  3.   

    delete from 表 where WLBH<>'02-02-001'
      

  4.   

    delete from tabname
    where wlbh not in ('02-02-001')