select *
from jr_loan_channel_staterecode t
where t.channel_id = 9
and not exists (select *
from jr_loan_channel_staterecode
where loan_id = t.loan_id
and channel_id = 9
and apply_state_id = t.apply_state_id
and oper_time < t.oper_time)
order by oper_time
from jr_loan_channel_staterecode t
where t.channel_id = 9
and not exists (select *
from jr_loan_channel_staterecode
where loan_id = t.loan_id
and channel_id = 9
and apply_state_id = t.apply_state_id
and oper_time < t.oper_time)
order by oper_time