Skip to content
Advertisement

PostgreSQL group by column with aggregate

I need to group by id and select the task with min/max seq as start and end

But this results in

But I do not want group by seq

Advertisement

Answer

One method uses arrays:

Another method uses window functions with SELECT DISTINCT:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement