字段A 字段B 字段C
 1    1      2
 2    1      2
 3    2      2
 4    3      2
我想去掉字段B的重复数据,然后返回这三个字段的结果要怎么写啊
结果大概是这样
2    1    2
3    2    2
4    3    2

解决方案 »

  1.   

    你给的数据是按b、c去的重
    select max(a),b,c from table group by b,c
      

  2.   

    select max(a),b,MAX(c) from table group by b
    给的数据没问题啊?
      

  3.   

    select a,b,c
    from(select a,b,c,row_number() over(patition b order by a desc) rec_no
    from table)  where rec_no=1;
      

  4.   

    delete from  temp t
    where rowid in (
          select max(d.rowid) from temp d
          group by d.number2)
    2 1 2
    3 2 2
    4 3 3