Marco Bambini <ma...@sqlabs.net> wrote:
> CREATE TABLE foo (id integer PRIMARY KEY AUTOINCREMENT,connection_date text);
> 
> and I insert data into this table using the syntax:
> INSERT INTO foo (connection_date) VALUES (datetime('now','localtime'));
> INSERT INTO foo (connection_date) VALUES (datetime('now','localtime'));
> 
> I need to create a query that is able to retrieve all the id(s) from foo 
> where connection_date is older than 5 minutes starting
> from now (in localtime). 

select id from foo where connection_date < datetime('now', '-5 minutes', 
'localtime');

Be careful on those days when the time switches between standard and daylight 
savings.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to