Another variation:

select avg(max) from (select distinct max(val) over(partition by id) from
mytable);


Cheers,
Greg

--
Crunchy Data - https://www.crunchydata.com
Enterprise Postgres Software Products & Tech Support

Reply via email to