Exclude max element from each row – Postgresql
I wrote sql select array_agg(id) as ids from fff group by a_c_id, a_c_dttm, a_c_code having COUNT(*)>1 which returns results {5,9} {8,12,13} {6,10} {7,11} How to exclude max value in each row for getting this result? {5} {8,12} {6} {7} the…