H2 limit and offset, is there a guarantee on ordering?
H2 limit and offset, is there a guarantee on ordering? When using LIMIT and OFFSET, what are the guarantees that each such statement will order the input in the same way? To illustrate: If: SELECT FROM toys ORDER BY price ASC LIMIT 3; returns: Can i be sure the next query: SELECT FROM toys ORDER BY price ASC LIMIT 3 OFFSET 3; returns: After all, all three balls have the same price, so any ordering of the three rows is valid. You should include a second key in the order by so the sort is stable (that is, the keys have no ties). – Gordon Linoff Jun 29 at 16:48 order by @Gordon, so it's up to me to construct the 'order by' so that ordering is defined? I can add an index at creation time for this. – Ivana Jun 29 at 17:09 ...
