Here is a SQL Server method ive used for paged results. Just tell it how
many results per page and what page you are on. The example assumes 25
results and page 3 of those results



DECLARE @PageNum AS INT;
DECLARE @PageSize AS INT;
SET @PageNum = 3;
SET @PageSize = 25;

WITH articlesRN AS
(
    SELECT  ROW_NUMBER() OVER(ORDER BY articleDate desc) AS RowNum
,           *
    FROM    tblArticles
)

SELECT      *
FROM  articlesRN
WHERE RowNum BETWEEN    (@PageNum - 1) * @PageSize + 1 
                 AND    @PageNum * @PageSize
ORDER BY articleDate desc;





-----Original Message-----
From: Bobby Hartsfield [mailto:[email protected]] 
Sent: Thursday, March 25, 2010 7:45 AM
To: cf-talk
Subject: RE: how to incremently fetch data


Which database server are you using?

-----Original Message-----
From: sandeep saini [mailto:[email protected]] 
Sent: Thursday, March 25, 2010 12:15 AM
To: cf-talk
Subject: how to incremently fetch data


Hi,

I run some query and per say fetch 100 records. now i run other query which
fetch 150 records.

I want that just 50 records be actually fetched in second round from
database.

How can this be possible? fyi- i am using MachII for my application.

Thanks. 





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332246
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to