/****** Object: StoredProcedure [dbo].[usp_getnewslist] Script Date: 08/09/2013 10:19:48 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[usp_getnewslist]
@classificationId varchar(50),--类别id
@startid int , --开始的rownumberid
@titlenum int --页面上显示的条数
---结束的rownumberid
as
with a as (
SELECT ROW_NUMBER() OVER (ORDER BY id) AS RowNumber,* FROM tb_news where tb_news.classificationId=@classificationId
)
select * from a where a.RowNumber>=@startid and RowNumber<(@startid+@titlenum) order by a.releaseTime desc