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 <achambers.h...@gmail.com>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 ('001','d','N'); > insert into events values ('001','e','Y'); > insert into events values ('001','f','Y'); > insert into events values ('001','g','N'); > > Is it possible, using plain SQL, to derive the following > > 001,c,d > 001,e,g > > i.e. an "N" in the third column means event "001" has stopped, and a > "Y" means it > has started back up again. Note that because the status immediately > preceding "f" > is also "Y", there is no corresponding row in the output > > Cheers, > Andy > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- VerifEye Technologies Inc. 905-948-0015x245 7100 Warden Ave, Unit 3 Markham ON, L3R 8B5 Canada _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users