从Table表中取出第m条到第n条的记录,有办法把两个LIKE归为一个LIKE么
SELECT TOP n-m+1 id FROM Table WHERE (id NOT IN (SELECT TOP m-1 id FROM Table WHERE title LIKE '%关键字%')) and title LIKE '%关键字%'
SELECT TOP n-m+1 id FROM Table WHERE (id NOT IN (SELECT TOP m-1 id FROM Table WHERE title LIKE '%关键字%')) and title LIKE '%关键字%'
(
select id0=row_number() over(order by id),* from tablename
)
select * from cte where id0 between n to m WHERE title LIKE '%关键字%
select TOP (n-m+1) from #t order by....