query to show sub aggregation