Postgres First_Value en Gropby

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