Re: [sqlite] How to get the previous row before rows matching a where clause...

2009-03-22 Thread Jim Wilcoxson
What about: select blah from blah where rowid < windowstartrowid order by rowid desc limit 1 to get the row before, and: select blah from blah where rowid > windowlastrowid limit 1 to get the row after. Jim On 3/22/09, sorka wrote: > > I have a table of events

Re: [sqlite] How to get the previous row before rows matching a where clause...

2009-03-22 Thread Dennis Cote
sorka wrote: > I have a table of events that have a title, start time, and end time. > > The start time is guaranteed unique, so I've made it my primary integer key. > > I need all events that overlap the a window of time between say windowstart > and windowend. Currently, the statement > >

Re: [sqlite] How to get the previous row before rows matching a where clause...

2009-03-22 Thread P Kishor
On Sun, Mar 22, 2009 at 4:23 PM, sorka wrote: > > I have a table of events that have a title, start time, and end time. > > The start time is guaranteed unique, so I've made it my primary integer key. > > I need all events that overlap the a window of time between say

[sqlite] How to get the previous row before rows matching a where clause...

2009-03-22 Thread sorka
I have a table of events that have a title, start time, and end time. The start time is guaranteed unique, so I've made it my primary integer key. I need all events that overlap the a window of time between say windowstart and windowend. Currently, the statement SELECT title FROM event WHERE