Skip to content

Instantly share code, notes, and snippets.

@ahmad-moussawi
Created January 5, 2019 07:49
Show Gist options
  • Save ahmad-moussawi/892334d4f0d84503700eb33b105ce634 to your computer and use it in GitHub Desktop.
Save ahmad-moussawi/892334d4f0d84503700eb33b105ce634 to your computer and use it in GitHub Desktop.
Pagination in multiple databases
SELECT * FROM (
  SELECT "subquery".*, ROWNUM "row_num" FROM (
  SELECT "id", "name" from "Users"
  ) "subquery" WHERE ROWNUM <= 20
) WHERE "row_num" >= 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment