aggregation having should compose with and and or