Re: [sqlite] finding rows within a certain time interval of another row

2008-03-26 Thread Igor Tandetnik
"P Kishor" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Given a table t (name, date) > > I want to find all rows within, say, 6 months of a specific row, say > name = 'foo'. So, I am doing > > SELECT name > FROM t > WHERE >(SELECT julianday(date) FROM t WHERE name = 'foo')

[sqlite] finding rows within a certain time interval of another row

2008-03-25 Thread P Kishor
Given a table t (name, date) I want to find all rows within, say, 6 months of a specific row, say name = 'foo'. So, I am doing SELECT name FROM t WHERE (SELECT julianday(date) FROM t WHERE name = 'foo') - julianday(date) < 180 OR julianday(date) - (SELECT julianday(date) FROM