问题描述:怎样在数据库的一个表里筛选出每一人的时间最新的一条记录
select * from
(
select b.user_code,
b.name,
b.dept_code,
b.register_time,
b.is_valid,
b.superior_code,
b.group_worker,
b.member_level,
b.activation_state,b.activation_date, max(b.update_time) over(partition by b.user_code) as uptime_max,b.update_time
from test.t_pms_user_base b
) x where x.update_time=x.uptimeMax sort by x.user_code;