Skip to Content
0
Dec 15, 2017 at 12:44 PM

How does "select ... limit x offset y" work? Is it deterministic?

593 Views

Hello,

as far as I understand SQL there is no garantee that a "select top x"-statement would always return the same resultset. As there is no explicit "order by" the resultset is not deterministic.
Is this the same with "select ... limit x offset"?
Do I need to use an "order by" to be sure to get the same results every time (no chages to the table)? Or is there an implicit order? If so: On which columns (index?, what if no primary key on the table?)

I am sorry for that bunch of questions on that topic, but I cannot find anything on that in the documentation.