title: DENSE_RANK() without duplication
body: <p>Here's what my data looks like:</p>
  
  <pre><code>| col1 | col2 | denserank | whatiwant |
  |------|------|-----------|-----------|
  | 1    | 1    | 1         | 1         |
  | 2    | 1    | 1         | 1         |
  | 3    | 2    | 2         | 2         |
  | 4    | 2    | 2         | 2         |
  | 5    | 1    | 1         | 3         |
  | 6    | 2    | 2         | 4         |
  | 7    | 2    | 2         | 4         |
  | 8    | 3    | 3         | 5         |
  </code></pre>
  
  <p>Here's the query I have so far:</p>
  
  <pre><code>SELECT col1, col2, DENSE_RANK() OVER (ORDER BY COL2) AS [denserank]
  FROM [table1]
  ORDER BY [col1] asc
  </code></pre>
  
  <p>What I'd like to achieve is for my denserank column to <strong>increment</strong> every time there is a change in the value of col2 (even if the value itself is reused). I can't actually order by the column I have denserank on, so that won't work). See the <code>whatiwant</code> column for an example.</p>
  
  <p>Is there any way to achieve this with <code>DENSE_RANK()</code>? Or is there an alternative?</p>