I am writing a wpf destop application, and would like to use SQL Server CE as a backend. I\'m trying to come up with a good way to do efficient data paging. In SQL Server
There are a few ways, but the most simplistic way would be like the following:
Assuming
Then
SELECT
[Page].[ID],
[Page].[FirstName],
[Page].[LastName]
FROM
(
SELECT TOP (10)
[FirstRows].[ID],
[FirstRows].[FirstName],
[FirstRows].[LastName]
FROM
(
SELECT TOP (20)
[TestTable].[ID],
[TestTable].[FirstName],
[TestTable].[LastName]
FROM
[TestTable]
ORDER BY
[TestTable].[ID] ASC
) AS [FirstRows]
ORDER BY
[FirstRows].[ID] DESC
) AS [Page]
ORDER BY
[Page].[ID] ASC