On 2017/03/09 10:11 AM, Dominique Devienne wrote:
Nice! Thanks Ryan. --DD
PS: If we ever meet, your reasonably-priced beverage of choice is on me :)
You're welcome, and safe, since I'm teetotal - which means I totally
only drink tea. :)
(Been this way since that fatal PUI incident - that's
On Wed, Mar 8, 2017 at 6:38 PM, R Smith wrote:
>
> On 2017/03/08 5:35 PM, Dominique Devienne wrote:
>
>>
>> Now I only need a CTE to dynamically generate the ranges,
>>
>
> Well, that seems like fun!
> If I may...
>
Nice! Thanks Ryan. --DD
PS: If we ever meet, your reasonably-priced beverage of
On Wed, Mar 8, 2017 at 6:08 PM, Simon Slavin wrote:
>
> On 8 Mar 2017, at 3:35pm, Dominique Devienne 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 th
On 2017/03/08 5:35 PM, Dominique Devienne wrote:
Now I only need a CTE to dynamically generate the ranges,
Well, that seems like fun!
If I may...
-- CTEs
-- Units Table (B, KB, MB, etc.)
WITH UT(id, uStr, byteDiv) AS (
SELECT 0, 'B', 1
UNION ALL
SELECT UT.id+1,
CASE
On 8 Mar 2017, at 3:35pm, Dominique Devienne 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
On Wed, Mar 8, 2017 at 3:47 PM, Clemens Ladisch wrote:
> Dominique Devienne wrote:
> > On Wed, Mar 8, 2017 at 3:16 PM, Hick Gunter wrote:
> >> Alternatively create a "range" table, insert your defined ranges and
> >> join/subquery to the original query.
> >
> > That's the easy part [...]
> > but
On 8 Mar 2017, at 2:33pm, Dominique Devienne wrote:
> 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
In that case, I think Hick’s solution is good. Do it in two steps: construct a
temporary table whi
Dominique Devienne wrote:
> On Wed, Mar 8, 2017 at 3:16 PM, Hick Gunter wrote:
>> Alternatively create a "range" table, insert your defined ranges and
>> join/subquery to the original query.
>
> That's the easy part [...]
> but the join/subquery you mention is still leaving me scratching my head..
On Wed, Mar 8, 2017 at 3:16 PM, Hick Gunter 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,
On Wed, Mar 8, 2017 at 2:53 PM, Simon Slavin wrote:
> On 8 Mar 2017, at 1:46pm, Dominique Devienne 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
> > combin
von Simon Slavin
Gesendet: Mittwoch, 08. März 2017 14:53
An: SQLite mailing list
Betreff: Re: [sqlite] SQL help: by-range aggregation
On 8 Mar 2017, at 1:46pm, Dominique Devienne wrote:
> I'd like to aggregate the sum of the size per-parent, from 1KB, to
> each range from low to 8*
On 8 Mar 2017, at 1:46pm, Dominique Devienne 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
Given a table with a (parent, child) PK, which carries a size "data" column,
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 boun
13 matches
Mail list logo