we're in sql now, we should use aggregation!