时间:2021-07-01 10:21:17 帮助过:2人阅读
查询最新时间的每个人的记录
SELECT *
FROM station2015 a
WHERE EXISTS
(SELECT 1
FROM
(SELECT StationNum,
MAX(DataTime) New_Time
FROM station2015
GROUP BY StationNum) b
WHERE a.StationNum = b.StationNum
AND a.DataTime = b.New_Time)
sql 语句
标签: