日期:2014-05-18 浏览次数:20393 次
insert into a select datetime+3,value from a where datetime between '2011-11-25' and '2011-11-27'
------解决方案--------------------
没看懂楼主是什么意思,可参考如下:
--获取两个时间之内的所有日期 --sql 2000 declare @sdate datetime declare @edate datetime set @sdate = '2011-11-28' set @edate = '2011-11-30' select dateadd(dd,num,@sdate) dt from (select isnull((select count(1) from sysobjects where id<t.id),0) as num from sysobjects t) a where dateadd(dd,num,@sdate)<=@edate /* dt ------------------------------------------------------ 2011-11-28 00:00:00.000 2011-11-29 00:00:00.000 2011-11-30 00:00:00.000 (所影响的行数为 3 行) */
------解决方案--------------------