skip to Main Content

How to use first_value window function to get last non null value in Postgresql

I want to perform a fill-down activity in PgSQL DDL: create table brands ( id int, category varchar(20), brand_name varchar(20) ); insert into brands values (1,'chocolates','5-star') ,(2,null,'dairy milk') ,(3,null,'perk') ,(4,null,'eclair') ,(5,'Biscuits','britannia') ,(6,null,'good day') ,(7,null,'boost') ,(8,'shampoo','h&s') ,(9,null,'dove'); Expected output is: category…

VIEW QUESTION
Back To Top
Search