with m as (select m.date
                , n.site_id
                , sum(cell_availability_num)                                    as availability_num
                , sum(cell_availability_denum)                                  as availability_denum
                , nds(sum(cell_availability_num), sum(cell_availability_denum)) as new_availability
           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-01'
           group by date
                  , n.site_id)
select *
from m
order by site_id, date;