select
--substr(to_date('data_time','yyyy-mm-dd'),1,10) ,
substr(data_time,1,10) as date,
substr(concat(substr(data_time,1,13),':00:00'),11,10) as time,
count(distinct utdid) as uv
from
max_bbj.dwd_insurance_news_pv_uv_daily
where datediff(now(),to_date(pt,'yyyy-mm-dd')) <= 30
and data_time is not null
group by substr(data_time,1,10),substr(concat(substr(data_time,1,13),':00:00'),11,10)
order by substr(data_time,1,10),substr(concat(substr(data_time,1,13),':00:00'),11,10);