title: ORACLE how to use RANK function
body: <p>Good Morning,</p>
  
  <p>I can not get the result what I want right now.</p>
  
  <p>for example my code is</p>
  
  <pre><code>select 
      a.donor_id AS ID
    , a.date_of_record
    , RANK() OVER (PARTITION BY a.donor_id,a.date_of_record  ORDER BY date_of_record) r_nk
  from table a
  </code></pre>
  
  <p>The result is</p>
  
  <pre><code>ID ----------------Date_of_record-----r_nk
  012                12/14/2017         1
  012                12/20/2017         1
  012                12/20/2017         1
  </code></pre>
  
  <p>however I would like to show like this</p>
  
  <pre><code> ID ----------------Date_of_record-----r_nk
      012                12/14/2017         1
      012                12/20/2017         1
      012                12/20/2017         2
  </code></pre>
  
  <p>I am not sure why the code above is not working,</p>
  
  <p>Thank you so much!!!</p>