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? Quote 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! Quote 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; Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.