The modification time of the latest piece of data for each user in the SQL server query time interval

user

username User id Add time
select  用户名 (
	select 用户名 ,row_number () OVER ( PARTITION BY  用户id ORDER BY 新增时间) AS row_number 
	from user
	where 新增时间 >'yyyy-mm-dd'
) a where row_number  ='1'

Guess you like

Origin blog.csdn.net/zhongzih/article/details/108060055