On Wed, Mar 8, 2017 at 6:08 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> > On 8 Mar 2017, at 3:35pm, Dominique Devienne <ddevie...@gmail.com> wrote: > > > > Then the results where in alphabetical order of bucket names, > > so I had to re-join on ranges to order by ranges.low. > > You should be able to just add the ORDER BY clause to the original JOIN: > > SELECT ranges.name, bytes_per_set.v > FROM bytes_per_set > JOIN ranges ON bytes_per_set.v >= ranges.low > AND bytes_per_set.v < ranges.high > ORDER BY ranges.low Thanks, but that doesn't work, because the later aggregation loses that order. And I also want to preserve "holes in the middle", so I need a left-join somewhere, and at the very end is the only I can make this work (not that there's not a better way). --DD _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users