I need to calculate the difference about two dates between records from the same table.
I have a table called: “ treatments” with the fields: “id”, ”date”, “animalId”, and “treatment”.
I need to calculate the difference between “treatments” in days.
I know “datadiff” function, but I don’t know how to compare one record with the next one (or previous).
Thanks