SELECT p.PatientID, v.VisitID, v.HeartRate, v.VisitDate FROM Patient p INNER JOIN Visit v ON p.PatientID = v.PatientID WHERE v.VisitDate = ( SELECT MIN(VisitDate) FROM Visit WHERE PatientId = p.PatientId )
编辑:替代版本.一样.(不太明显,因此不太理想的恕我直言)
SELECT p.PatientID, v.VisitID, v.HeartRate, v.VisitDate FROM Patient p INNER JOIN Visit v ON p.PatientID = v.PatientID INNER JOIN ( SELECT PatientID, MIN(VisitDate) VisitDate FROM Visit GROUP BY PatientID ) f ON f.PatientID = p.PatientID AND f.VisitDate = v.VisitDate