34,590
社区成员
发帖
与我相关
我的任务
分享
select 用户名,电子邮件,时间
from tb t
where not exists(select 1 from tb where 电子邮件=t.电子邮件 and 时间>t.时间) and PerFlag_1=0
order by 时间 desc
select 用户名,最后登录时间,电子邮件
from 表名
where 电子邮件 in
(select distinct 电子邮件 from 表名 where datediff(year,时间字段名,getDate()=0)
order by 最后登录时间 desc
datediff(year,时间字段名,getDate()=0表示去年的时间
select 用户名,最后登录时间,电子邮件
from 表名
where 电子邮件 in (select distinct 电子邮件 from 表名)
order by 最后登录时间 desc
select 用户名,电子邮件,时间
from tb t
where not exists(select 1 from tb where 电子邮件=t.电子邮件 and 时间>t.时间)
order by 时间 desc