def METHOD_NAME(self):
    metric_cols = self.metric.column_names
    metric_cols_no_subscriber = [cn for cn in metric_cols if cn != "subscriber"]
    location_cols = self.spatial_unit.location_id_columns
    # Make some comma separated strings for use in the SQL query
    metric_list = ", ".join(f"metric.{c}" for c in metric_cols)
    # We need to do this because it may be the case that
    # a location is identified by more than one column, as
    # is the case for lon-lat values
    loc_list = ", ".join(f"location.{lc}" for lc in location_cols)
    loc_list_no_schema = ", ".join(location_cols)
    metric = self.metric.get_query()
    location = self.locations.get_query()
    joined = f"""
    SELECT
        {metric_list},
        {loc_list}
    FROM
        ({metric}) AS metric
    INNER JOIN
        ({location}) AS location
    ON metric.subscriber=location.subscriber
    """
    if self.method == "distr":
        grouped = " UNION ".join(
            f"""
            SELECT
                {loc_list_no_schema},
                '{mc}' AS metric,
                key,
                value / SUM(value) OVER (PARTITION BY {loc_list_no_schema}) AS value
            FROM (
                SELECT
                    {loc_list_no_schema},
                    {mc}::text AS key,
                    COUNT(*) AS value
                FROM joined
                GROUP BY {loc_list_no_schema}, {mc}
            ) _
            """
            for mc in metric_cols_no_subscriber
        )
        grouped = f"WITH joined AS ({joined}) {grouped}"
    else:
        av_cols = ", ".join(
            f"{self.method:{mc}} AS {mc}" for mc in metric_cols_no_subscriber
        )
        # Now do the group by bit
        grouped = f"""
        SELECT
            {loc_list_no_schema},
            {av_cols}
        FROM ({joined}) AS joined
        GROUP BY {loc_list_no_schema}
        """
    return grouped