with master as (select '2g'     as tech,
                       date,
                       yearweek as weekly,
                       site_id,
                       ne_id
                from r11.meas_2g_daily m
                         join network_cell n on m.network_cell_id = n.id
                where date between '2023-12-01' and '2023-12-07'
                group by date, yearweek, site_id, ne_id
                union
                select '4g'     as tech,
                       date,
                       yearweek as weekly,
                       site_id,
                       ne_id
                from r11.meas_4g_daily m
                         join network_cell n on m.network_cell_id = n.id
                where date between '2023-12-01' and '2023-12-07'
                group by date, yearweek, site_id, ne_id)
select tech,
       date,
       weekly,
       site_id,
       ne_id
from master
order by tech, ne_id, date;