title: Modifying a WITH CTE AS statement
body: <p>Trying to figure out how to modify this WITH CTE AS statement. What I have below will update my StackCustomerAltID numericly with the customers in ABC order that are not blank and Delflg = 0. But I need to figure out how to modify it to update my StackCustomerAltID numericly, customers in ABC order with the blank customers. But the problem seems to be the blanks. I tried removing the where clause but it puts the blanks first then the ones that have actual customers in them.</p>
  <p>Existing Query</p>
  <pre><code>WITH CTE AS(
      SELECT StackCustomerAltID,
             ROW_NUMBER() OVER (ORDER BY Customer) AS RN
      FROM dbo.StackCustomer Where DelFlg = 0 and Customer &lt;&gt; '')
  UPDATE CTE
  SET StackCustomerAltID = RN;
  </code></pre>
  <p>without where clause</p>
  <pre><code>WITH CTE AS(
      SELECT StackCustomerAltID,
             ROW_NUMBER() OVER (ORDER BY Customer) AS RN
      FROM dbo.StackCustomer )
  UPDATE CTE
  SET StackCustomerAltID = RN;
  </code></pre>