On Wed, Mar 8, 2017 at 2:53 PM, Simon Slavin <slav...@bigfraud.org> wrote:
> On 8 Mar 2017, at 1:46pm, Dominique Devienne <ddevie...@gmail.com> wrote: > > I'd like to aggregate the sum of the size per-parent, from 1KB, to each > > range > > from low to 8*low (i.e. [low, 8*low)), but w/o having to write my hand > all > > possible > > combination, with extra points for formatting the range bounds in KB, MB, > > GB as appropriate. > > Does your programming language allow you to implememnt a SQLite external > function which takes a value and returns a string indicating which range > its in ? > > This would allow you to implement triggers on INSERT and UPDATE which > automatically set a 'category' field in the table. Then you could filter > on value, or use GROUP BY, or other things. > Same constraints of the "thousand separator" one, this will be a view in a DB to be viewed by any SQLite client, so not allowed here. --DD PS: will be allowed the day SQLite embeds a lightweight programming language and allows defining "persistent" User Defined Functions in the DB itself, in a sqlite_functions table for example :) _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users