Skip to content

Instantly share code, notes, and snippets.

@diegodfsd
Created September 26, 2018 16:28
Show Gist options
  • Save diegodfsd/1d5e18a8975f673e8ba651069625bdbf to your computer and use it in GitHub Desktop.
Save diegodfsd/1d5e18a8975f673e8ba651069625bdbf to your computer and use it in GitHub Desktop.
/*
* Exemplo de paginação usado na plataforma
*/
SELECT *
FROM (SELECT Row_number() OVER (ORDER BY NAME ASC) peta_rn,
i.[id],
i.[uniqueid],
i.[name]
FROM [core].[instances] i
WHERE (NOT (i.status = @0) AND i.tenantid = @1 )) peta_paged
WHERE peta_rn > @2 AND peta_rn <= @3
-> @0 [Int32] = "4"
-> @1 [Int32] = "4"
-> @2 [Int64] = "0"
-> @3 [Int64] = "10"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment