Answers for "max function 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 "SQL"

Browse Popular Code Answers by Language