我有表 tbMeasurement 和 tbPatientMeasurement 。
tb测量
MeasurementIDP
MeasurementName
tb患者测量
PatientMeasurementIDP
MeasurementIDF
MeasurementValue
Taken (Datetime)
执行以下查询时:
SELECT DISTINCT dbo.tbMeasurement.MeasurementName
, dbo.tbPatientMeasurement.MeasurementValue
, dbo.tbPatientMeasurement.Taken
FROM dbo.tbMeasurement
INNER JOIN dbo.tbPatientMeasurement
ON dbo.tbMeasurement.MeasurementIDP = dbo.tbPatientMeasurement.MeasurementIDF
这将返回 MeasurementName 之一的双重条目。我也想要MeasurementName,MeasurementValue by max Taken(datetime).