

show_region_aggregation = '''
        SELECT
            i.name
            , SUM(d.value) as value
            , r.full_name
        FROM region_relationship rr
        INNER JOIN datapoint d
            ON rr.region_1_id = d.region_id
        INNER JOIN indicator i
            ON d.indicator_id = i.id
        INNER JOIN region r
            ON rr.region_0_id = r.id
        GROUP BY r.full_name, i.name,i.id ,d.campaign_id
        '''



show_region_aggregation = '''
        SELECT
            i.name
            , SUM(d.value) as value
            , r.name
        FROM region_relationship rr
        INNER JOIN datapoint d
            ON rr.region_1_id = d.region_id
        INNER JOIN indicator i
            ON d.indicator_id = i.id
        INNER JOIN region r
            ON rr.region_0_id = r.id
        GROUP BY r.name, i.name,i.id ,d.campaign_id
        '''

Fix a bug in the region aggregation query.
Fix a bug in the region aggregation query.

There is no full_name column for regions; it is just name.

  
  
  show_region_aggregation = '''
          SELECT
              i.name
              , SUM(d.value) as value
-             , r.full_name
+             , r.name
          FROM region_relationship rr
          INNER JOIN datapoint d
              ON rr.region_1_id = d.region_id
          INNER JOIN indicator i
              ON d.indicator_id = i.id
          INNER JOIN region r
              ON rr.region_0_id = r.id
-         GROUP BY r.full_name, i.name,i.id ,d.campaign_id
+         GROUP BY r.name, i.name,i.id ,d.campaign_id
          '''
  
Fix a bug in the region aggregation query.
## Code Before:


show_region_aggregation = '''
        SELECT
            i.name
            , SUM(d.value) as value
            , r.full_name
        FROM region_relationship rr
        INNER JOIN datapoint d
            ON rr.region_1_id = d.region_id
        INNER JOIN indicator i
            ON d.indicator_id = i.id
        INNER JOIN region r
            ON rr.region_0_id = r.id
        GROUP BY r.full_name, i.name,i.id ,d.campaign_id
        '''

## Instruction:
Fix a bug in the region aggregation query.
## Code After:


show_region_aggregation = '''
        SELECT
            i.name
            , SUM(d.value) as value
            , r.name
        FROM region_relationship rr
        INNER JOIN datapoint d
            ON rr.region_1_id = d.region_id
        INNER JOIN indicator i
            ON d.indicator_id = i.id
        INNER JOIN region r
            ON rr.region_0_id = r.id
        GROUP BY r.name, i.name,i.id ,d.campaign_id
        '''
