Answers for "postgresql partition group by"

SQL
1

postgresql partition group by

SELECT 
    product_id,
    product_name,
	group_id,
    price,
    FIRST_VALUE(product_name) 
    OVER(
	PARTITION BY group_id
        ORDER BY price
        RANGE BETWEEN 
            UNBOUNDED PRECEDING AND 
            UNBOUNDED FOLLOWING
    ) lowest_price
FROM 
    products;
Posted by: Guest on January-29-2021

Code answers related to "postgresql partition group by"

Code answers related to "SQL"

Browse Popular Code Answers by Language