Postgres First_value w Gropby

try using "DISTINCT" instead of "GROUP BY", then use the "PARTITION BY"
clause inside the first_value.
GutoTrosla