34,587
社区成员
发帖
与我相关
我的任务
分享
select userId ,username,max(logintime) as logintime from t1 group by userId ,username
where userId ='张三'
SELECT userID,userName,
MAX(loginTime) OVER(PARTITION BY userID,userName)
FROM TB
select * from tb a
where logintime=(select max(logintime) from tb where userId=a.userId)
select * from tb a
where logintime=(select max(logintime) from tb where userId=a.userId)
---已测试