with h_asign_id as (
select asign_id from assign_h h
left join assignment a on a.id = h.asign_id
where 1=1
group by h.asign_id
)
select h.asign_id from assign_history h, h_asign_id i
where
h.id in ( select max(assign_h.id) from assign_h where assign_hasign_id = h.asign_id)
and
h.asign_id = i.asign_id
时间: 2024-10-08 09:58:13