你用时间来排序:
select * from T_Articles where CreateTime > @startTime and CreateTime < @endTime order by CreateTime
或者用Row_Number()函数来排序,实现无刷新分页:
select * from
(
SELECT Id, Title, Contents, Author, CreateTime, TypeId, ArtiId,TypeName, Row_Number() OVER (ORDER BY CreateTime) as rownum
FROM T_Articles
)t
WHERE t.rownum >= @startRowIndex AND t.rownum <= @endRowIndex
|