I am working with tables in mysql
and I am not able to delete the oldest records with respect to the dates, there are several users who have several records but I just want to leave the most recent records of each user
select min(updated_at) as olds
from vital_signs group by id order by patient_id
This would be my query in SQL that brings me all the records I want to delete, but when I add the delete I get an error