title: Exclude null values using DENSE_RANK
body: <p>Dense_Rank is taking everything into account. Is there a way to exclude the null values so the next rank after 1 would be 2 and not 3.</p>
  
  <p>This is what the table looks like now:</p>
  
  <pre><code> A     | DENSE_R 
   --------------
   1     | 1  
   --------------
   2     | null  
   --------------
   3     | 3 
   --------------
   4     |  4    
  </code></pre>
  
  <p>This is what I want the table to look like:</p>
  
  <pre><code> A     | DENSE_R 
   --------------
   1     | 1  
   --------------
   2     | null  
   --------------
   3     | 2 
   --------------
   4     |  3  
  </code></pre>
  
  <p>I'm using the following code to do so:-</p>
  
  <pre><code>WITH CTE AS
  (
   SELECT A 
   FROM A1
  )
  SELECT A,
  CASE 
    WHEN  **Condition**
    THEN DENSE_RANK() OVER (Order by [A] ASC)
  END
  AS 'DENSE_R'
  FROM CTE
  </code></pre>