I have MySQL with a date
column and system_week_end
date column. The system_week_end
column has the situation of one or two week missing values.
Note
- the
system_week_end
can be any day of the week. I am not able to the end std end of week function - the
system_week_end
is subset filtered by a columncompany
each company set their thesystem_week_end
date. - the
date
column contains every day, no missing values.
Here is an example of the data:
date system_week_end
2020-01-05 2020-01-05
2020-01-04 <null>
2020-01-03 <null>
2020-01-02 <null>
2020-01-01 <null>
2019-12-31 <null>
2019-12-30 <null>
2019-12-29 <null>
2019-12-28 <null>
2019-12-27 <null>
2019-12-26 <null>
2019-12-25 <null>
2019-12-24 <null>
2019-12-23 <null>
2019-12-22 2019-12-22
2019-12-21 <null>
2019-12-20 <null>
2019-12-19 <null>
2019-12-18 <null>
2019-12-17 <null>
2019-12-16 <null>
2019-12-15 2019-12-15
How would I structure a MySQL query to infill null for the system_week_end
column?
For example:
2020-01-05 2020-01-05
2020-01-04 2020-01-05
2020-01-03 2020-01-05
2020-01-02 2020-01-05
2020-01-01 2020-01-05
2019-12-31 2020-01-05
2019-12-30 2020-01-05
2019-12-29 2019-12-29
2019-12-28 2019-12-29
2019-12-27 2019-12-29
2019-12-26 2019-12-29
2019-12-25 2019-12-29
2019-12-24 2019-12-29
2019-12-23 2019-12-29
2019-12-22 2019-12-22
2019-12-21 2019-12-22
2019-12-20 2019-12-22
2019-12-19 2019-12-22
2019-12-18 2019-12-22
2019-12-17 2019-12-22
2019-12-16 2019-12-22
2019-12-15 2019-12-15