开发者

How to select n number of rows in ms access

开发者 https://www.devze.com 2022-12-24 21:06 出处:网络
Here is a table patients in MS开发者_如何学编程 access database, There is 20 records, I want to select first 0 10 records and after 11-20 records for pagination. How to solve this problemIf it\'s ok t

Here is a table patients in MS开发者_如何学编程 access database, There is 20 records, I want to select first 0 10 records and after 11-20 records for pagination. How to solve this problem


If it's ok to order your output by primary key you could do something like this:

Select top 10 *
from patients
where patientid > @id

You would need to keep track of the last id shown on the page, sending that to the query every time. This won't work if you sort by something other than the id

0

精彩评论

暂无评论...
验证码 换一张
取 消