New answers tagged

0

If you want to make sure that all days are the same, just compare the min and max. If they are the same, then all values are the same as well. with dif_zero as ( select d.id, date_part('day', p.docdate)::int pday from sh_billing.dogovor d join sh_billing.pays p on p.dogovor_id = d.id and p.is_actual ) select id from dif_zero group by id ...


0

You could create your own aggregate to append arrays: CREATE AGGREGATE array_append_agg(anyarray) ( SFUNC = pg_catalog.array_cat, STYPE = pg_catalog.anyarray ); Then use that aggregate function in your outer query.


Top 50 recent answers are included