Limitby should be executed after olderby. Are you sure that is not the case? What DB?
On Jun 9, 2:52 am, pbreit <pbreitenb...@gmail.com> wrote: > I have a query that includes both orderby and limitby. What seems to happen > is that the db returns some set of records as dictated by the limit and then > orders the records in that set. So I pretty much get the same set every time > even though I know the field being ordered has changed for various records. > Is this how SQL works? Is there any way to order the whole set first and > then return the sub-set?