7,714
社区成员
发帖
与我相关
我的任务
分享
select a.tname,a.tdate-max(b.tdate) as 相差天数
from Table1 a ,Table1 b
where a.tdate>b.tdate and a.tname=b.tname
group by a.tname,a.tdate
select a.姓,a.tdate-max(b.tdate) as 相差天数
from yourTable a ,yourTable b
where a.tdate>b.tdate
group by a.姓