Tip Postgres: Používejte 'filtr' místo 'case when' pro psaní podmíněných agregátů! Je čitelnější, idiomatický SQL a často funguje lépe!