Created
March 22, 2022 16:26
-
-
Save Francisco-Castillo/5ac1f76ad02809e9f215e54fcd9b1ade to your computer and use it in GitHub Desktop.
Paginacion en DB2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT * FROM COBERTURAS c | |
ORDER BY c.ID | |
LIMIT (:current_page - 1) * :rows_per_page,:rows_per_page; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
El
LIMIT m,n
representa el desplazamiento, y la cantidad de registros a retornar por cada pagina.A modo de ejemplo, utilizando estos argumentos, la consulta retorna los "primeros 5 registros"
Luego, incrementando el valor de
current_page
hacia la siguiente pagina, la consulta retorna los "segundos 5 registros"Por último, se puede modificar la cantidad de registros por pagina (
rows_per_page
), y hacer que la consulta retorne "10 registros por página"