select datetime
     , n.site_id
     , r.branch
     , r.rtpo
     , r.kota_kabupaten
     , avg(packet_loss_rate_of_twamp_detecting_link)  as packet_loss_rate_of_twamp_detecting_link
     , avg(average_delay_of_twamp_detecting_link_ms)  as average_delay_of_twamp_detecting_link_ms
     , avg(average_jitter_of_twamp_detecting_link_ms) as average_jitter_of_twamp_detecting_link_ms
from r11.pl_4g_15min p
         join network_site n on p.network_site_id = n.id
         join ref_site r on r.site_id = n.site_id
where p.date between '2023-12-01' and '2023-12-01'
group by datetime
       , n.site_id
       , r.branch
       , r.rtpo
       , r.kota_kabupaten
order by branch, rtpo, kota_kabupaten, n.site_id, datetime
;