title: SQL - Distinct in case
body: <p>I would like to use a distinct with a case:</p>
  <pre><code>create table project_reports (id integer, project_id integer, keyword_id integer, position integer);
  
  insert into project_reports
  values
  (1,  1,    1,   4),
  (2,  1,    1,   5),
  (3,  1,    1,   6),
  (5,  1,    2,   7),
  (6,  1,    2,   8),
  (7,  1,    3,   5),
  (8,  1,    3,   7);
  </code></pre>
  <p>Query:</p>
  <pre><code>SELECT
    pr.position,
    CASE WHEN pr.position BETWEEN 4 AND 10 THEN keyword_id ELSE NULL END AS pos4
  FROM
    project_reports pr
  </code></pre>
  <p>I want the values on the column pos4 to be distinct.</p>
  <p>Expected:</p>
  <pre><code>  4-1
    7-2
    5-3
  </code></pre>
  <p>I have tried multiples things but nothing seems to work.</p>
  <p>Thanks</p>