Answers for "how to select rows with max date in group by"

SQL
0

group by max date

SELECT train, dest, time FROM ( 
  SELECT train, dest, time, 
    RANK() OVER (PARTITION BY train ORDER BY time DESC) dest_rank
    FROM traintable
  ) where dest_rank = 1
Posted by: Guest on August-09-2021

Code answers related to "how to select rows with max date in group by"

Code answers related to "SQL"

Browse Popular Code Answers by Language