Let's create a simple table with order dates.
with prep as (select 'Xbox' as product, '20201010' as orderdateunion all select 'PS5', '20201011'union all select 'PS5', '20201012'union all select 'PS5', '20201013'union all select 'PC (master race)', '20201012'union all select 'PC (master race)',…