📅  最后修改于: 2022-03-11 15:05:27.210000             🧑  作者: Mango
SELECT DISTINCT
t1.CompliancyID ,t1.[Status],t1.FK_ClientID
FROM #VettingCompliance t1
INNER JOIN
(
SELECT FK_ClientID, min(CompliancyID) AS CompliancyID FROM #VettingCompliance GROUP BY FK_ClientID
) t2 ON t2.CompliancyID = t1.CompliancyID AND t1.FK_ClientID = t2.FK_ClientID