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
相關文章
相關標籤/搜索