📜  如何仅选择最大值 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:39.398000             🧑  作者: Mango

代码示例1
SELECT tt.*
FROM topten tt
INNER JOIN
    (SELECT home, MAX(datetime) AS MaxDateTime
    FROM topten
    GROUP BY home) groupedtt 
ON tt.home = groupedtt.home 
AND tt.datetime = groupedtt.MaxDateTime