select A.point_id, A.schedule_calendar_id, A.date, count(*) cnt
from (
select distinct s.user_id, s.point_id, s.schedule_calendar_id, sc.date
from schedule s
join schedule_calendar sc on s.schedule_calendar_id = sc.id
) A
group by A.point_id, A.schedule_calendar_id, A.date
having count(*) > 1
<div class="form__input-file">
<input class="visually-hidden" type="file" id="file">
<label for="file">
тут рисуй рамку и что хочешь делай
<span>Добавить</span>
</label>
</div>
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;