on 2024 Jul 18 1:27 PM
mssql sql:
set statistics time on; -- Paging query (general type) select * from student order by sno offset ((@pageIndex-1)*@pageSize) rows fetch next @pageSize rows only; -- Pagination query page 2, each page has 10 records select * from student order by sno offset 10 rows fetch next 10 rows only ;
Where is the documentation on how to implement distributed query?
Request clarification before answering.
You can "paginate" queries in SQL Anywhere via several forms of "row-limitation" clauses, either
SELECT TOP n START AT m ... FROM
or similar to MySQL via
SELECT ... FROM ... LIMIT x OFFSET y
or
SELECT ... FROM ... LIMIT y, x
where n = x and y = m -1 (i.e. START AT 21 is equivalent to OFFSET 20), and can be expressed with constants or variables.
It's documented, of course. (The doc link goes to version 17.0.1 but both clauses are avilable in version 12, too.
Note the following hint:
The LIMIT keyword is disabled by default. Use the reserved_keywords option to enable the LIMIT keyword.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
53 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.