Postgresql – SQL: two aggregate functions without duplicates
How to use two aggregate functions (for example double string_agg or just sum), but ensure that the results do not contain duplicates caused by the other aggregate function (caused by second join)? I use PostgreSQL. Example I have three tables:…