22,209
社区成员
发帖
与我相关
我的任务
分享
select a.title,b.dtime from MContent a WITH(NOLOCK)
inner join (select id,dtime from MContent where dtime between '2017-11-1' and '2017-11-10') b on a.id=b.id
where contains(title,'大于')
试着变形看看select title,dtime from MContent WITH(NOLOCK) where contains(title,'大于') and convert(char(8),dtime,112) between '20171101' and '20171110'
WITH cte AS (
select title,dtime from MContent WITH(NOLOCK) where contains(title,'大于')
)
SELECT * FROM cte WHERE dtime >='2017-11-01' and dtime <='2017-11-10'
把这分开两步执行不知道行不行啊