wudi

博客园 首页 新随笔 联系 订阅 管理

 

 

select name from
testB a where
exists
(
   select * from testB b
   where b.InsertTime = DATEADD(D,1,a.InsertTime) and a.name=b.name
)
and
exists
(
   select * from testB b
   where b.InsertTime = DATEADD(D,2,a.InsertTime) and a.name=b.name
)
group by name

posted on 2010-09-02 17:23  菜鸟吴迪  阅读(2320)  评论(0编辑  收藏  举报