答案 0 :(得分:1)
您需要使用MAX
功能和GROUP BY
。这应该从您的表中选择最新的SCAN_DATE
SELECT
LAST_NAME
,FIRST_NAME
,MAX(SCAN_DATE)
,WEIGHT
,HEIGHT
FROM Test
-- If using SQL
GROUP BY LAST_NAME, FIRST_NAME, CAST(SCAN_DATE AS Date), WEIGHT, HEIGHT
-- If using MySQL
-- GROUP BY LAST_NAME, FIRST_NAME, DATE(SCAN_DATE), WEIGHT, HEIGHT