ranking-function Using window functions will allow you to use different aggregations over specific columns of data.