Re: [sqlite] Tricky grouping query

2010-10-02 Thread luuk34
On 01-10-10 22:30, Igor Tandetnik wrote: > Andy Chambers wrote: >> Given the following >> >> create table events ( >> id, >> date, >> status >> ); >> insert into events values ('001','a','N'); >> insert into events values ('001','b','N'); >> insert into events

Re: [sqlite] Tricky grouping query

2010-10-01 Thread Igor Tandetnik
Andy Chambers wrote: > Given the following > > create table events ( > id, > date, > status > ); > insert into events values ('001','a','N'); > insert into events values ('001','b','N'); > insert into events values ('001','c','Y'); > insert into events values

Re: [sqlite] Tricky grouping query

2010-10-01 Thread Nicolas Williams
On Fri, Oct 01, 2010 at 08:37:07PM +0100, Andy Chambers wrote: > Given the following > > create table events ( > id, > date, > status > ); > insert into events values ('001','a','N'); > insert into events values ('001','b','N'); > insert into events values ('001','c','Y'); > insert into

Re: [sqlite] Tricky grouping query

2010-10-01 Thread Drake Wilson
Quoth Andy Chambers , on 2010-10-01 20:37:07 +0100: > Is it possible, using plain SQL, to derive the following > > 001,c,d > 001,e,g In other words, you're comparing rows with "adjacent" ones? Yes, it's probably possible, but it would be very awkward and possibly slow.

Re: [sqlite] Tricky grouping query

2010-10-01 Thread Adam DeVita
Why would you want to do this in plane sql, as opposed to using the API to go through the list and derive it? On Fri, Oct 1, 2010 at 3:37 PM, Andy Chambers wrote: > Given the following > > create table events ( > id, > date, > status > ); > insert into events

[sqlite] Tricky grouping query

2010-10-01 Thread Andy Chambers
Given the following create table events ( id, date, status ); insert into events values ('001','a','N'); insert into events values ('001','b','N'); insert into events values ('001','c','Y'); insert into events values ('001','d','N'); insert into events values ('001','e','Y'); insert into