declare @t table(brq varchar(10),erq varchar(10),hh int,ye dec(6,2))
insert into @t select '2006-01-02' ,'2012-10-1',1111 ,2.01
union all select '2006-01-05' ,'2012-10-31',1111 ,3.51
union all select '2006-01-10' ,'2012-10-1',1111 ,2.55
union all select '2006-01-02' ,'2012-10-30',2222 ,3.00
union all select '2006-01-04' ,'2012-10-1',2222 ,2.00
union all select '2006-01-05' ,'2012-10-1',3333 ,6.54
union all select '2006-01-06' ,'2012-10-1',3333 ,5.23
union all select '2006-01-07' ,'2012-10-1',3333 ,8.55 select * from @t where convert(nvarchar(10),getdate(),120) between brq and erq
结果我明白,取出包含当前日期区间的记录,
请问 convert(nvarchar(10),getdate(),120) between brq and erq 里的convert(nvarchar(10),getdate(),120)起什么作用
这个between是怎么运行的?
解决方案 »
- XML格式化数据如何导入SQL server2008
- 求助:EXEC sp_executesql sql拼接'+'不能用
- SQL 查询 高手帮忙!!
- SQL事件探查器中显示回滚了,但是把那个执行插入存储过程语句拿到查询分析器中,确能正常执行这是为什么???
- 如何判断某个字段是否存在重复记录?
- bcp咋用嗫?
- sql分组的问题
- 为什么我的SQL老是占用资源 100% ?但是整台电脑的速度并不觉得慢。
- ORA-00600: internal error code, arguments: [kcbgcur_3], [1], [9], [4202506],??
- 正在数据库选型中彷徨!望高手指点!
- 求最优算法
- 在MSSQL中,如何从课程表按课程名选出所上班级名及上课时间
2012-10-30 17:12:53.027 转换成 2012-10-30
你运行一下就知道了就是把日期的时间部分去掉