title: ROW_NUMBER() OVER Function did not run through all records
body: <p>I have a table like this</p>
  
  <pre><code>ID  Date    Sale    Sale_desc
  1   1/1/2017    10  book
  1   1/1/2017    10  book
  1   1/1/2017    10  book
  2   1/2/2017    12  notebook
  2   1/2/2017    12  notebook
  3   1/3/2017    1   pen
  3   1/3/2017    1   pen
  </code></pre>
  
  <p>I ran the following query to get the row number:</p>
  
  <pre><code>select *, row_number() over (partition by id order by date) 
  from the_table;
  </code></pre>
  
  <p>But the result was not what I expected. </p>
  
  <pre><code>ID  Date        Sale    Sale_desc   row_num
  1   1/1/2017    10      book        1
  1   1/1/2017    10      book        1
  1   1/1/2017    10      book        1
  2   1/2/2017    12      notebook    1
  2   1/2/2017    12      notebook    2
  3   1/3/2017    1       pen         1
  3   1/3/2017    1       pen         2
  </code></pre>
  
  <p>The row_num for the first 3 rows should be 1, 2, 3 but it looks like the row_num() did not run through all the rows. Please help. Thank you</p>