Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #group #max #date
ADD COMMENT
Topic
Name
5+9 =