Re: [GENERAL] Limit record count

2007-12-17 Thread Rodrigo Gonzalez
DELETE FROM WHERE NOT IN (SELECT FROM ORDER BY DESC LIMIT 50) Sean Z. escribió: Hi, I need to write a maintenance function to delete oldest records of a table, leaving only a certain number of records, say 50. The task should run once per day. How can I write it? The oldest record ca

[GENERAL] Limit record count

2007-12-17 Thread Sean Z.
Hi, I need to write a maintenance function to delete oldest records of a table, leaving only a certain number of records, say 50. The task should run once per day. How can I write it? The oldest record carries the smallest ID. Thanks a lot! Sean __