UPDATE annual changes with discontinuous dates
问题 This answer has shown me how to get annual changes from data: UPDATE values_table as a join values_table as b ON b.date_sampled = DATE_SUB(a.date_sampled, INTERVAL 1 YEAR) set a.annual_change = a.sample_value - b.sample_value And this answer has shown me how to find the closest date to an INTERVAL (relative to NOW() with 3 results, in this question's case): SELECT event_id FROM Table ORDER BY ABS( DATEDIFF( EVENT_START_DATE, NOW() ) ) LIMIT 3 How can the two be combined to get annual rates of