查询一周内的数据 RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 insert into @t select '2008-04-3'insert into @t select '2008-04-4'insert into @t select '2008-04-5'insert into @t select '2008-04-6'insert into @t select '2008-04-7'insert into @t select '2008-04-8'insert into @t select '2008-04-9'insert into @t select '2008-04-10'insert into @t select '2008-04-11'insert into @t select '2008-04-12'insert into @t select '2008-04-13'insert into @t select '2008-04-14'insert into @t select '2008-04-15'insert into @t select '2008-04-16'insert into @t select '2008-04-17'insert into @t select '2008-04-18'declare @dt datetimeset @dt='2008-04-11'select * from @twhere datepart(wk,@dt)=datepart(wk,dt) and abs(datediff(dd,@dt,dt))<72008-04-07 00:00:00.0002008-04-08 00:00:00.0002008-04-09 00:00:00.0002008-04-10 00:00:00.0002008-04-11 00:00:00.0002008-04-12 00:00:00.0002008-04-13 00:00:00.000 这样查和datefirst有关,上面我设置了set datefirt 1 select *from tawhere datepart(wk,datecol) = datepart(wk,getdate()) 对case子句排序 SQL Server的连接问题(在线等啊) 删除2条相同记录的前一条记录 (详进) 请高手帮忙 存储过程中调用当前时间进行判断?? 当前时间怎样获得,请高手指点一下!多谢! 急!!!!!!!!!!!!!!!!!~~~~~~~求个SQL语句 关于阻塞连接的疑问 SQL的安装问题:点击AUTORUN.EXE之后就有问题了? 这个存储过程怎么写 update更新多条记录奇怪的问题 Sql视图语句,用字段值作为视图字段的查询 大哥们请进,一个优化问题。 这样记录集能用一条SQL检索不?
insert into @t select '2008-04-4'
insert into @t select '2008-04-5'
insert into @t select '2008-04-6'
insert into @t select '2008-04-7'
insert into @t select '2008-04-8'
insert into @t select '2008-04-9'
insert into @t select '2008-04-10'
insert into @t select '2008-04-11'
insert into @t select '2008-04-12'
insert into @t select '2008-04-13'
insert into @t select '2008-04-14'
insert into @t select '2008-04-15'
insert into @t select '2008-04-16'
insert into @t select '2008-04-17'
insert into @t select '2008-04-18'declare @dt datetime
set @dt='2008-04-11'select * from @t
where datepart(wk,@dt)=datepart(wk,dt) and abs(datediff(dd,@dt,dt))<72008-04-07 00:00:00.000
2008-04-08 00:00:00.000
2008-04-09 00:00:00.000
2008-04-10 00:00:00.000
2008-04-11 00:00:00.000
2008-04-12 00:00:00.000
2008-04-13 00:00:00.000
上面我设置了
set datefirt 1
from ta
where datepart(wk,datecol) = datepart(wk,getdate())