select
distinct on(msg1) *
from
(
select
ii.id ,
ii.msg1 ,
ii.msg2 ,
ii.msg3
from
st_schema.inter_info ii
inner join st_schema.uniq_tmp_1 ui
on
ii.msg_id = ui.imp_id
where
ii.collection_time = ui.collection_time
order by
collection_time desc
)
得到的结果:对msg1去重后,带着其他字段得到结果。