visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Databases :: General :: how to delete one month before record from datadase using mysql delete query


By: Nono Great Britain  Date: 11/06/2007 16:33:04  English  Points: 20 Status: Answered
Quality : Excellent
how to delete one month before record from datadase using mysql delete query ?
By: VGR Date: 11/06/2007 17:11:02 English  Type : Answer
hummmm something like this ? (should work in ALL SQL-92 compliant databases)

delete from yourtable where thedatefield < now() - interval 1 month;



NB I suggest to do afterwards a table compression (reclaiming the unused space - like a defrag/diskopt/stacker call) ; if you're using MySql, then it's simply :

optimize table yourtable;


Do register to be able to answer

EContact
browser fav
page generated in 291.435000 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page