select a.* from (select id,姓名,操作,时间,row_number() over(partiton by 姓名 order by 时间 desc) rn from table where 时间=?) a where a.rn=1
select max(id),max(姓名),操作,max(时间) from 表 where between 小时间 and 大时间
select id,姓名,操作,时间 from tb where 时间 in(select 时间 from tb where 时间>=dt and 时间<=dt2 group by 姓名)
select a.* from (select id,姓名,操作,时间,row_number() over(partiton by 姓名 order by 时间 desc) rn from tb_name where 姓名=?) a where a.rn=1
select a.* from (select id, 姓名, 操作, 时间, row_number() over(partiton by 姓名 order by 时间 desc) rn from table where 时间 between XXX and YYY) a where a.rn = 1
select id,姓名,操作,时间 from tb where 时间 in(select max(时间) from tb where 时间>=dt and 时间<=dt2 group by 姓名)
select t1.id,t1.姓名,t1.操作,t1.时间 from tb t1 where t1.时间 in (select max(t2.时间) from tb t2. where t1.id = t2.id and t2.时间>=dt and t2.时间<=dt2 group by t2.id)
from (select id,姓名,操作,时间,row_number() over(partiton by 姓名 order by 时间 desc) rn
from table
where 时间=?) a
where a.rn=1
from tb where 时间 in(select 时间 from tb where 时间>=dt and 时间<=dt2 group by 姓名)
from (select id,姓名,操作,时间,row_number() over(partiton by 姓名 order by 时间 desc) rn
from tb_name
where 姓名=?) a
where a.rn=1
from (select id,
姓名,
操作,
时间,
row_number() over(partiton by 姓名 order by 时间 desc) rn
from table
where 时间 between XXX and YYY) a
where a.rn = 1
from tb where 时间 in(select max(时间) from tb where 时间>=dt and 时间<=dt2 group by 姓名)
from tb t1 where t1.时间 in
(select max(t2.时间) from tb t2. where t1.id = t2.id and t2.时间>=dt and t2.时间<=dt2 group by t2.id)