这也不是啥重赏。。。。要啥勇夫。。。
select convert(date,tt1.cur) cur ,convert(date,tt1.pre) pre,datediff(day,convert(date,tt1.pre),convert(date,tt1.cur)) as dis from (select top 1 a as cur ,1 AS orderNum ,a as pre from aaa
union all
(select t1.a as cur,t1.orderNum,t2.a as pre from (SELECT a,ROW_NUMBER() OVER (ORDER BY a) AS orderNum FROM aaa) t1 ,
(SELECT a,ROW_NUMBER() OVER (ORDER BY a) AS orderNum FROM aaa) t2
where t1.orderNum=t2.orderNum+1)) tt1