title: Row_Number with Teradata GROUPBY
body: <p>I am trying to determine how I can use the <code>ROW_NUMBER()</code> function with TERADATA using the result set below. Here is what i have tried:</p>
  
  <pre><code>select col1, col2, ROW_NUMBER() OVER (ORDER by col2  ) 
      FROM
       (select col1, col2 
      from TABLE
      ORDER BY col2) A
  </code></pre>
  
  <p>Result Set</p>
  
  <pre><code>38  11/14/2016  1
  38  11/15/2016  2
  38  11/16/2016  3
  38  11/17/2016  4
  38  11/18/2016  5
  38  11/19/2016  6
  39  11/20/2016  7
  39  11/21/2016  8
  39  11/22/2016  9
  39  11/23/2016  10
  39  11/24/2016  11
  39  11/25/2016  12
  </code></pre>
  
  <p>Expected:</p>
  
  <pre><code>Col1    Col2    Col3
  38  11/14/2016  1
  38  11/15/2016  1
  38  11/16/2016  1
  38  11/17/2016  1
  38  11/18/2016  1
  38  11/19/2016  1
  39  11/20/2016  2
  39  11/21/2016  2
  39  11/22/2016  2
  39  11/23/2016  2
  39  11/24/2016  2
  39  11/25/2016  2
  </code></pre>