Delete from A Where ID Not In (Select Min(ID) from A Group By RQ,SJ,C )

解决方案 »

  1.   

    Delete a from tb a inner join tb as b on a.fid<b.fid and a.c=b.c and a.rq=b.rq and a.sj=b.sj
      

  2.   

    Delete from A Where ID Not In (Select Min(ID) from A Group By RQ,SJ,C )
    跟著游泳的魚跑﹗
      

  3.   

    Delete from A Where ID Not In (Select Min(ID) from A Group By RQ,SJ,C )些句中的MIN起什么作用.
      

  4.   

    delete from A t
    where exists(select 1 from A where ID<A.ID and SJ=t.SJ and RQ=t.RQ and C=t.c)
      

  5.   

    paoluo(一天到晚游泳的鱼),语句写得很巧妙,支持!
      

  6.   

    Min(ID)不是取最小的一个id了吗? 请解释下:)
      

  7.   

    Min是取最小的,语句就是将相同的RQ,SJ,C,不是最小的ID删除掉,就是楼主要的结果了。
      

  8.   

    但是假如表A没有字段ID,要得到如题的结果,该怎么做呢?
      

  9.   

    想知道结果
    ================================================================
    助跑网:http://www.zhupao.com
    ================================================================