窗口函数 row number + partition by 排序
数据排序后再取第一个值
select * from
(
select *,
Row_Number() over (partition by uid order by created_at ) rank
from ods_lps_kkb_cloud_edu.student_homework_record
where
homework_id=37
)
rank=1
2023-10-13 15:43:34
数据排序后再取第一个值
select * from
(
select *,
Row_Number() over (partition by uid order by created_at ) rank
from ods_lps_kkb_cloud_edu.student_homework_record
where
homework_id=37
)
rank=1