On Wed, Mar 8, 2017 at 3:16 PM, Hick Gunter <h...@scigames.at> wrote:

> Alternatively create a "range" table, insert your defined ranges and
> join/subquery to the original query.
>
> Create table range (label text, from integer, to integer);
>

That's the easy part (and a CTE can probably generate it dynamically, and
even I could come up with that CTE):

create table ranges (name text, low integer, high integer)
insert into ranges values
('[0, 1KB)', 0, 1024),
('[1KB, 8KB)', 1024, 8*1024),
('[8KB, 64KB)', 8*1024, 8*8*1024),
('[64KB, 512KB)', 8*8*1024, 8*8*8*1024),
('[512KB, 4MB)', 8*8*8*1024, 8*8*8*8*1024),
('[4MB, 32MB)', 8*8*8*8*1024, 8*8*8*8*8*1024),
('[32MB, MAX)', 8*8*8*8*8*1024, 8*8*8*8*8*8*1024);

but the join/subquery you mention is still leaving me scratching my head...
--DD
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to