I am working on a ecommerce site with products, products variants, etc.
I have made a complex query that throws the following results.

```
 id | product_id | options 
----+------------+---------
  1 |          1 | 1
  2 |          1 | 1
  3 |          1 | 1
  4 |          1 | 2
  5 |          1 | 2
  6 |          1 | 3
  7 |          1 | 3
  8 |          1 | 1
  9 |          1 | 4

```

What I need to do, is selecting the first record for each different option value. In the last example I need to write a select statement to return the following rows:

```
 id | product_id | options 
----+------------+---------
  1 |          1 | 1
  4 |          1 | 2
  6 |          1 | 3
  9 |          1 | 4

select distinct (options,product_id) , id from(
      <The query that returns the rows on this question>
  ) as prodvalues
group by product_id, options;

```

But no luck with that. I am really stucked.
Any help? Thanks!