Simplify CSV query
Simplify CSV query

+ Use DISTINCT ON and inverse RANGE to get the last row of a window
  frame
+ Use array_agg instead of nth_value to avoid repetition

aalto-trafficsense/regular-routes-server,aalto-trafficsense/regular-routes-server,aalto-trafficsense/regular-routes-server,aalto-trafficsense/regular-routes-server