On Sun, Jul 15, 2012 at 11:25 AM, Steven E. Harris wrote:
> There are a few examples in the "Numeric Encoding" section of the
> Wiki page titled "SQLite4: Key Encoding"¹ that I don't understand.
> Are these examples wrong on the Wiki page, or am I misunderstanding the
> encoding
Luis Mochan wrote:
> I want to reorder a table and then group and average it's values. I
> tried something similar to
>
> SELECT AVG(a) FROM (SELECT a FROM table ORDER BY a) group by ROWID/10;
>
> in order to take the average 'a' for groups of 10 succesive values.
Something
Klaas Van Be
writes:
> More about this:
> http://en.wikipedia.org/wiki/IEEE_floating_point
Thanks, but the question doesn't have anything to do with the IEEE 754
representation, with which I'm familiar enough. The question here
concerns SQLite's new numeric value encoding used in keys, which
Steven E. Harris wrote:
Another one I can't figure out:
Value Exponent E Significand M (in hex)
= = ==
100.1 2 03 02
I expect that this should have the digits 01, 00, and 10, yielding:
2 * 01 + 1 = 3 = 0x03
2 * 00 + 1
Thanks Keith!
Creating a temporal table with it's own rowid solved the problem.
Luis
On Sun, Jul 15, 2012 at 10:48:32AM -0600, Keith Medcalf wrote:
> How about:
>
> drop table if exists temp.ordered;
> create temporary table ordered (a number not null);
> insert into ordered select a from table
How about:
drop table if exists temp.ordered;
create temporary table ordered (a number not null);
insert into ordered select a from table order by a;
select avg(a) from ordered group by rowid/100;
drop table if exists temp.ordered;
---
() ascii ribbon campaign against html e-mail
/\
I want to reorder a table and then group and average it's values. I
tried something similar to
SELECT AVG(a) FROM (SELECT a FROM table ORDER BY a) group by ROWID/10;
in order to take the average 'a' for groups of 10 succesive values. My
example fails. To understand I tried
SELECT ROWID FROM
There are a few examples in the "Numeric Encoding" section of the
Wiki page titled "SQLite4: Key Encoding"¹ that I don't understand. I
think the table entries may be erroneous. By working through the
examples here, I hope to either correct my misunderstading or to get the
Wiki page corrected.
8 matches
Mail list logo