701     1
701     1 
701     2
701     2
702     1
702     1
703     4
703     4現在想做區域合并﹐就是701,702,703的區域﹐﹐請問如何寫sql啊

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/5076/5076556.xml?temp=.6155054
      

  2.   

    不是行轉列的問題﹐是區域合并變為
    701   1
    701   2
    702   1
    704   4
    不能用group by啊,,大俠如果解決啊
      

  3.   

    你这是行重了吧,你先给每行建个ID,不能重复的,然后改一下下面的SQL试试吧
    delete tab1 where ID  in ( select max(ID),col1 from tab1 group by col1)
      

  4.   

    select distinct row1,row2 //distinct后跟着几列就对后面几列进行组合排除重复记录
    from table