no              seq_no                    station                time  
select * from tbname
where (no,seq_no) in (select no,max(seq_no) from tbname
group by no);

解决方案 »

  1.   

    select * from tbname
    where (no,seq_no) in (select no,max(seq_no) from tbname
    group by no);
      

  2.   

    select no,seq_no,station,time
      from (
             select no,seq_no,station,time,
                    row_number() over (partition by no order by seq_no desc) rn
               from table1
           )
     where rn = 1;
      

  3.   

    select no,max(seq_no) station from tbname group by no;
      

  4.   

    select distinct * from (
    select 
       no,
       first_value(seq_no) over (partition by no order by time desc rows unbounded preceding) lastseq_no,
       first_value(station) over (partition by no order by time desc rows unbounded preceding) laststation,
       first_value(time) over (partition by no order by time desc rows unbounded preceding) lasttime      
    from tabname);