文章目录
-
- 原题题目
- 代码实现(首刷自解)
原题题目
代码实现(首刷自解)
# Write your MySQL query statement below
SELECT user_id,time_stamp AS last_stamp
FROM (SELECT user_id,time_stamp,RANK() OVER(PARTITION BY user_id ORDER BY time_stamp DESC) AS rnkFROM loginsWHERE year(time_stamp) = 2020) t
WHERE rnk = 1