While i haven't needed this functionality, i have been thinking about
how it could be solved in a performant way.
IMHO, the solution would be to create a virtual table that takes, for
example, as input a query that produces the following rows:
C1 | C2
--------
a1 | b1
a2 | b2
a3 | b3
and outputs the following:
C1 | C2 | C1prev | C2prev
----------------------------------
a1 | b1 | null | null
a2 | b2 | a1 | b1
a3 | b3 | a2 | b2
So in essence the window gets transformed to a single row. In a similar
way, bigger windows could also be transformed.
l.
On 20/09/12 14:46, Gabor Grothendieck wrote:
On Wed, Sep 19, 2012 at 12:51 PM, joe.fis...@tanguaylab.com
<joe.fis...@tanguaylab.com> wrote:
Too bad SQLite doesn't yet support SQL Window Functions.
Are there any SQLite Extension Libraries that support "SQL:2003 type Window
Functions"?
I specifically need LEAD and LAG to calculate an event integer timestamp
delta between consecutive rows.
I've played with some self-join code but that's proving to be complicated.
SQL Window Functions is the number one feature that I could use as
well. In R, sqlite can be used for manipulating R data frames via the
sqldf package and this sort of functionality would be very useful.
(sqldf also handles PostgreSQL which does have windowing functions but
PostgreSQL requires more set up than sqlite so its not as accessible
to users.)
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users