I'm trying to delete the last added entry of a table:
DELETE FROM notes ORDER BY created_at DESC LIMIT 1
This just causes the following error:
near "ORDER": syntax error
Why might I be getting this error? (notes
exists and has records in it!)
Try this
DELETE FROM notes WHERE id = (SELECT MAX(id) FROM notes);