Jump to content

Deleting OLD Records


mcmuney

Recommended Posts

This may work but is dependant upon a rowID being present and the rowID having been incremented by 1 every time.

 

DELETE FROM `tblName` WHERE `rowID` <= ((SELECT COUNT(*) FROM `tblName`) - 10000)

 

or possibly

 

DELETE FROM `tblName` WHERE `rowID` <= ((SELECT `rowID` FROM `tblName` ORDER BY `rowID` DESC LIMIT 1) - 10000)

 

Give it a got haven't got time to test it right now.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.