SQL: Return only first occurrence

前端 未结 5 1833
慢半拍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:18

    Add this to your SQL:

    and where not exists
        (select 1 from personAttendances t2 
        where t.personID=t2.personID 
        and t2.seenID < t.seenID)
    

提交回复
热议问题