Delaran Posted May 9, 2007 Share Posted May 9, 2007 create trigger purge_old_timestamp after insert on wantdb begin delete * from wantdb where timestamp > datetime('now', '-2 months') end; How do I get this statement to delete entries older than two months? Do I already have the syntax correct? Link to comment https://forums.phpfreaks.com/topic/50692-solved-sqlite-timestamp-trigger-syntax-question-already-written/ Share on other sites More sharing options...
Delaran Posted May 9, 2007 Author Share Posted May 9, 2007 oops, i realized this is the wrong forum. Can I get this moved if any moderators have time? Sorry! Link to comment https://forums.phpfreaks.com/topic/50692-solved-sqlite-timestamp-trigger-syntax-question-already-written/#findComment-249192 Share on other sites More sharing options...
Delaran Posted May 9, 2007 Author Share Posted May 9, 2007 Not that it matters here, but when/if this thread is moved the correct syntax was: create trigger purge_old_entry after insert on wantdb begin delete from wantdb where timestamp = datetime('now', '-2 months'); end; Link to comment https://forums.phpfreaks.com/topic/50692-solved-sqlite-timestamp-trigger-syntax-question-already-written/#findComment-249282 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.