Skip to content
Advertisement

SELECT after specific row with non-sequential (uuid) primary key

With the following table:

How could I retrieve n rows after a specific id, ordered by inserted_at ?

Advertisement

Answer

I want to retrieve n rows after a specific id, ordered by inserted_at.

I am expecting something like this:

For this, you want one additional index on users(inserted_at).

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement