select seq,max(credit),reason,change_da from t1
group by seq,reason,change_da;
**************泪眼问花花不语
乱红飞过秋千去

解决方案 »

  1.   

    select * from t1 a where a.REASON=(select max(REASON) from t1 b where a.CREDIT =b.CREDIT);
    只要你读懂该语句,就一定能实现你的功能。
    他现在是找到了CREDIT中最大REASON的所有记录
      

  2.   

    应当这么写,只怪你没有对齐
    select * from t1 a where a.CREDIT=(select max(CREDIT) from t1 b where a.SEQ=b.SEQ);
      

  3.   

    select * from test where (subscrib_id,seq) in (
    select subscrib_id,max(seq) from test group by subscrib_id 
    )
      

  4.   

    对不起,有劳各位了,我写错了(没有对齐),正确应该如下:SUBSCRIB_ID       SEQ     CREDIT  REASON               CHANGE_DA
    ----------- ---------- ---------- -------------------- ---------
           2222          1       90   hihi                 21-AUG-02
           2222          3       90   hihi                 21-AUG-02
           1111          1       100  hihi                 21-AUG-02
           1111          2       95   hihi                 21-AUG-02
           3333          0       32   hihi                 21-AUG-02
           3333          6       67   hihi                 21-AUG-02通过一个什莫SQL语句列出如下结果SUBSCRIB_ID        SEQ     CREDIT REASON               CHANGE_DA
    ----------- ---------- ---------- -------------------- ---------
           2222          3        90  hihi                 21-AUG-02
           1111          2        95  hihi                 21-AUG-02
           3333          6        67  hihi                 21-AUG-02
      

  5.   

    select * 
     from t1 a
    where a.SEQ=(select max(b.SEQ) 
                      from t1 b
                     where a.SUBSCRIB_ID=b.SUBSCRIB_ID);
      

  6.   

    select seq,max(to_number(credit)),reason,change_da from t1
    group by seq,reason,change_da;