select * from (
select
*,
date(from_unixtime(created_at)) created_date,
row_number() over (partition by created_date order by created_at desc) rn
from tbl) row_numbers where rn = 1
select tbl.* from tbl
join (
select max(created_at) max_created_at
from tbl
group by date(from_unixtime(created_at))
) last_time on last_time.max_created_at = tbl.created_at;