You can use a recursive CTE. In MySQL, this looks like:
with recursive cte as (
select staff_member, start_date, 1 as week_number, start_date as week_start, start_date + interval 7 day as end_date
from t
union all
select staff_member, start_date, week_number + 1, end_date, end_date + interval 7 day
from cte
where year(start_date) = year(week_start)
)
select *
from cte
order by staff_member, week_start;
Here is a db<>fiddle.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…