SQL: Return only first occurrence

前端 未结 5 1834
慢半拍i
慢半拍i 2021-02-19 11:24

I seldomly use SQL and I cannot find anything similar in my archive so I\'m asking this simple query question: I need a query which one returns personID and onl

5条回答
  •  深忆病人
    2021-02-19 12:09

    You're making it way too difficult:

    select personID, min(seenTime)
    from personAttendances
    group by personID
    

提交回复
热议问题