with grouped_table as ( select date, day_of_week, inventory, count(inventory) over (order by date) as _grp from inventory_log ), final_table as( select date, day_of_week, inventory, _grp, first_value() over (partition by _grp order by date) as new_inventory from grouped_table ) select date, day_of_week, new_inventory from final_table
https://medium.com/towards-data-science/tips-and-tricks-how-to-fill-null-values-in-sql-4fccb249df6f
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.