I want to apply paging in a gridview or in an html table, in which I will fill using AJX. How to write questions to support paging? For example, the pagecases are 20 and when the user clicks on page 3, between 41 and 60 rows should be shown in the table. First of all, I can get all the records and put them in the cache but I think this is a wrong way. Because the data can be very large and the data can change with other sessions, how can I implement it? Is there any normal way (for all databases)?
As other people have suggested, you can use rownum in Oracle. Although it is a bit difficult and you have to queue your query twice.
For example, to pause the query
first_name from first_name to first_name / pre> You need it to be nest in this way Select first_name (first_name to first_name), where rn & gt; 100 and rn & lt; = 200
The reason for this is that rownum followed by where segment and before order section.
And you can find
4 Diane 2 Norm 3 Sam 1 Woody
< / Pre> This is the reason why Oracle evaluates this segment (none in this case), then specifies rownums, then first_name you must nest the query so that the rows are sorted
Uses the assigned rownum. Actually, if you ask "where rownum> 100" then you do not get any results. It's a chicken and egg item, as long as it can not return to any rows, unless it's 100% He sees, but since he does not return to any rows, he does not grow lonely, so it is counted as 100. The second level of nesting is resolved, note that it is necessary to nick the rownum column at this point.
Finally, the section should make your order a query determinant. For example, if you have John Doe and John Smith, and you only order by the first name, then they can change both locations from one executable to the next location.
The article here and here are now that I see how long my post is, maybe I should post those links now ...
Comments
Post a Comment