title: Using ranking functions without order by clause
body: <p>I have got a PostgreSQL database. There is a query that orders rows by <code>some_date</code> and <code>minutes</code>. The result looks like this:</p>
  <pre><code>id|is_smth|some_date |minutes
  35|true   |2021-11-10|985
  36|true   |2021-11-19|684
  35|true   |2021-11-25|605
  34|false  |null      |null
  </code></pre>
  <p>Then, I have tried applying <code>DENSE_RANK()</code> to it, to implement pagination in my application, but it does not work as I need it to, as it has to order the rows by given columns.</p>
  <p>What I am trying to achieve is just giving the rank to each row by the criteria specified in the original <code>ORDER BY</code> clause plus the <code>id</code> of the result set without changing their order. So, it would look like this:</p>
  <pre><code>id|is_smth|some_date |minutes|rank
  35|true   |2021-11-10|985    |1   
  36|true   |2021-11-19|684    |2   
  35|true   |2021-11-25|605    |1   
  34|false  |null      |null   |3   
  </code></pre>
  <p>I have to retrieve the first two rows AND all of the associated data with them (in this case it would be all of the other rows with ids 35 and 36). Is it possible?</p>