Seneste tid for et id
Jeg har set mig totalt blind på nedenstående tabelstruktur tblA og tblB bindes sammen af tblAB (klassisk).tblA
=========
person_id
=========
1
2
tblAB
===================================
person_id | status_id | status_time
===================================
1 | 75 | 2003-01-06
1 | 32 | 2003-01-08
1 | 75 | 2003-01-10
2 | 75 | 2003-01-13
2 | 32 | 2003-01-21
tblB
=========
status_id
=========
32
75
PROBLEMET ER at jeg skal bruge det seneste 'status_time' for HVERT 'person_id'. Altså skal resultatet af query'en være:
===================================
person_id | status_id | status_time
===================================
1 | 75 | 2003-01-10
2 | 32 | 2003-01-21