I think you want to do the following:
select t.* from (select t.*, row_number() over (partition by product_id order by (select NULL)) as seqnum from t ) t where seqnum = 1
This selects an arbitrary row for each product.
To delete all lines except one, you can use the same idea:
with todelete ( (select t.*, row_number() over (partition by product_id order by (select NULL)) as seqnum from t ) delete from to_delete where seqnum > 1
source share