title: SQL Oracle Specify start point using ROW_NUMBER()
body: <p>I got this code:</p>
  
  <pre><code>ROW_NUMBER() OVER (partition by ID ORDER BY ID DESC, year DESC, month DESC, day DESC) rank
  </code></pre>
  
  <p>I would like to fix the exactly year, month and day to start to rank. 
  Where should i put this condition in that situacion?</p>
  
  <p>Thank you in advance!</p>
  
  <p><strong>-----------------------------------------------------EDIT:----------------------------------------------------</strong></p>
  
  <p>I'm going to detail better my situtation in order to show you what I exactly want.</p>
  
  <p>Let's use this sample table and assume there are values for every date.</p>
  
  <pre><code>| Year | Month | Day | ID        | Rank       |
  |------|-------|-----|-----------|------------|
  | 2017 | 9     | 14  | 9555      | 1          |
  | 2017 | 9     | 13  | 9555      | 2          |
  | 2017 | 9     | 12  | 9555      | 3          |
  | 2017 | 9     | 11  | 9555      | 4          |
  | 2017 | 9     | 14  | 3000      | 1          |
  | 2017 | 9     | 13  | 3000      | 2          |
  | 2017 | 9     | 12  | 3000      | 3          |
  | 2017 | 9     | 11  | 3000      | 4          |
  </code></pre>
  
  <p>This table is what you can get using the following code:</p>
  
  <pre><code>Select *
  From (Select Year,
               Month,
               Day,
               ID,
               ROW_NUMBER() OVER (partition by ID ORDER BY ID DESC, Year DESC, Month DESC, Day DESC) rank
        From table1
        Where (Condition)
        )
  Where Rank &lt; 5;   
  </code></pre>
  
  <p>Our sample table is conditioned by the fact that the most recent row is from 14/09/2017.
  My question is how could I get the last 4 rows from 13/09/2017?</p>