-----如果user_id 和name一样 则取时间最新的一条数据
select user_id,time,name,school,age from
(select user_id,time,name,school,age , row_number() over (partition by user_id,name order by time ) row_id from table_name1) a
where row_id =1;
partition by 后面的字段就是会有重复记录的字段,如果有多条记录可以按照需求 用一个字段排序 然后 取到相应的数据