SqlServer_分組並取最新一條數據

分組取最新一條數據web select temp.userId from ( SELECT *,Row_Number() OVER (partition by userId ORDER BY inputTime desc) as rank FROM t_table ) temp where rank = 1
相關文章
相關標籤/搜索