Postgresql – How to select only rows with the max count per column value in a subgroup?
Table tmch contains thousands of rows here it is: CREATE TABLE IF NOT EXISTS public.tmch ( id bigserial NOT NULL, year integer, week integer, my_number integer, device_id bigint, CONSTRAINT tmch_pkey PRIMARY KEY (id) ) Sample data: 1716446 2024 37 13…