开发者

Is it possible to fetch database records in parts using SELECT statement?

开发者 https://www.devze.com 2023-02-10 01:56 出处:网络
Is it possible to fetch records in parts? Following will return 10,000 rows from my db: Select * from languages

Is it possible to fetch records in parts?

Following will return 10,000 rows from my db:

Select * from languages

I want to create the select statement that on press of a button it fetches first 1000 rows, then click a button and it fetch next 1000 rows.

Ho开发者_如何学JAVAw can I do it?


You can use the LIMIT {offset}, {row count} clause. This will return the first 1000 records

Select * from languages LIMIT 0,1000

To get the next 1000 records

Select * from languages LIMIT 1000,1000


are you just looking for the LIMIT clause? eg. select * from languages limit 1,1000

-- later get the next 1000
select * from languages limit 1001, 1000
0

精彩评论

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