Databases :: General :: how to delete one month before record from datadase using mysql delete query |
|||
| By: Nono |
Date: 11/06/2007 16:33:04 |
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 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








