同意libin_ftsafe(子陌红尘) ( )
在列上做了函数处理之后,将无法引用到列上创建的索引。
---------------------------------------------------
何不转换一下?
在列上做了函数处理之后,将无法引用到列上创建的索引。
---------------------------------------------------
何不转换一下?
---------------------------------------------------
那有没有什么解决方法呢?这个问题其实挺严重的,在很多情况下都要用到datediff作为过滤条件的,不会就只能转换形式成:
select * from table1 where A between '2005-12-01' and '2005-12-01 23:59:59'
吧
declare @d_date char(10)
set @d_date='2005-12-01'
select * from table1 where A between @d_date and @d_date+' 23:59:59'而实际上,我这个肯定要用变量的呀。请问这是为什么呢
set @d_date='2005-12-01'
select * from table1 where A between @d_date and @d_date+'23:59:59'
where A < '2005-12-30'
这样,十分快但
select top 1 * from table1
where A > '2005-12-30'
十分快,就是大于与小于的区别,为什么差别这么大。什么原理?
where A > '2005-12-30'
影响的行大于
select * from table1
where A < '2005-12-30'??????????????