with master as (select n.tech
                     , date
                     , n.site_id
                     , n.ne_id

                     , sum(tch_traffic_erlang) as traffic
                     , sum(payload_mbyte)      as payload_mbyte

                from r11.meas_2g_daily m
                         join network_cell n on m.network_cell_id = n.id
                         join ref_site r on n.site_id = r.site_id
                where date between '2023-12-01' and '2023-12-07'
                group by n.tech
                       , date
                       , n.site_id
                       , n.ne_id

                union

                select n.tech
                     , date
                     , n.site_id
                     , n.ne_id

                     , sum(volte_traffic_erl) as traffic
                     , sum(payload_mbyte)     as payload_mbyte

                from r11.meas_4g_daily m
                         join network_cell n on m.network_cell_id = n.id
                         join ref_site r on n.site_id = r.site_id
                where date between '2023-12-01' and '2023-12-07'
                group by n.tech
                       , date
                       , n.site_id
                       , n.ne_id)

select tech
     , date
     , site_id
     , ne_id
     , traffic::numeric(100, 2)       as traffic
     , payload_mbyte::numeric(100, 2) as payload_mbyte
from master
order by tech, site_id, ne_id, date
;