sql---在一张表中,有多人的多条数据,但只查询出每一个人最近的那一条数据!

SELECT * from patient_state a JOIN (select max(state_id) as state_id from patient_state group by patid) b ON b.state_id = a.state_id ORDER BY a.patid asc; 结果: web
相关文章
相关标签/搜索