Mysql – Return values from previous row based on date ordered union CTE running slowly
From the following table of sport matches: id_ p1_id p2_id match_date p1_stat p2_stat 852666 1 2 01/01/1997 1301 249 852842 1 2 13/01/1997 2837 2441 853471 2 1 05/05/1997 1474 952 4760 2 1 25/05/1998 1190 1486 6713 2 1…