title: Order of execution Oracle Select clause
body: <p>Consider a query with this structure:</p>
  <pre><code>select ..., ROWNUM
    from t
   where &lt;where clause&gt;
   group by &lt;columns&gt;
  having &lt;having clause&gt;
   order by &lt;columns&gt;;
  </code></pre>
  <p>As per my understanding, the order of processing is</p>
  <ol>
  <li>The FROM/WHERE clause goes first.</li>
  <li>ROWNUM is assigned and incremented to each output row from the FROM/WHERE clause.</li>
  <li>GROUP BY is applied.</li>
  <li>HAVING is applied.</li>
  <li>ORDER BY is applied.</li>
  <li>SELECT is applied.</li>
  </ol>
  <p>I cant understand why <a href="https://blogs.oracle.com/oraclemagazine/post/on-rownum-and-limiting-results" rel="nofollow noreferrer">this article</a> in Oracle magazine by TOM specifies:</p>
  <p>Think of it as being processed in this order:</p>
  <ol>
  <li>The FROM/WHERE clause goes first.</li>
  <li>ROWNUM is assigned and incremented to each output row from the FROM/WHERE clause.</li>
  <li>SELECT is applied.</li>
  <li>GROUP BY is applied.</li>
  <li>HAVING is applied.</li>
  <li>ORDER BY is applied.</li>
  </ol>
  <p>Can anyone explain this order?</p>