query order:

  1. FROM/WHERE
  2. add ROWNUM to every row from FROM/WHERE
  3. SELECT
  4. GROUP BY
  5. HAVING
  6. ORDER BY