So I would like to search for the max time in a column:
sqlite> SELECT max(strftime('%Y-%m-%d %H:%M',time)) FROM posts WHERE thread_id=123456;
2012-10-02 02:31
For each thread_id returned by this query:
sqlite> SELECT thread_id FROM threads WHERE out_of_date=0;
111
123
187
...
Then I would like to search for all threads whose last_post field don't match the time field returned by the first query, and set the out_of_date field to 1:
sqlite> UPDATE threads SET out_of_date=1 WHERE thread_id=123456 AND last_post!='2012-10-02 02:31';
Problem is, I'm not too sure how I should go about combining these three separate queries. Any thoughts?