Jump to content

[SOLVED] Deleting Oldest entery


mike12255

Recommended Posts

If you have a field which has an auto_incrementing value, you could use something like:

 

DELETE FROM table_name ORDER BY field_name ASC LIMIT 1;

 

This may well work in other situations but I've not tested! Also it doesn't necessarily need to be an auto_incrementing field, just an ASCending (or DESCending) pattern that you can rely on to be in order of old to new (or new to old).

 

Adam

sorry, just wrote an exam and school and got back, so lets say that the database looked like below, probually wont but something similar:

mysqlpl9.jpg

 

you guys say theres a way to deleate it using the date?

 

btw idk if that is setup right im not the best in mysql

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.