I need to transform a simple historical table to slowly changing dimention (exmpl below). What is the most efficient way to do that?
Input
ID - Update_date
----------
143432 - '2019-02-03'
143432 - '2019-11-01'
143432 - '2020-03-16'
Output
ID - row_actual_date_from - row_actual_date_to
----------
143432 - '2019-02-03' - '2019-10-31'
143432 - '2019-11-01' - '2020-03-15'
143432 - '2020-03-16' - '9999-12-31'