答案 0 :(得分:0)
I cannot tell exactly what your primary key is, but that is the only thing missing from the code.
Select s.*
From dbo.PUK_Status s
INNER JOIN (
SELECT [Whatever the PK is], MAX(ENDDATE) maxdate
from PUK_STATUS
WHERE PUK = '1628481'
) maxs
on s.[Whatever the PK is] = maxs.[Whatever the PK is]
and s.ENDDATE = maxs.ENDDATE