title: mysql error table cannot be used in global order clause
body: <pre><code>(SELECT dtable.* FROM app_detailsvvv as dtable INNER JOIN new_apps ON 
  new_apps.trackId=dtable.trackId WHERE primaryGenreName='Games' AND composed='1' AND
  new_apps.top&gt;0) UNION (SELECT * FROM app_detailsvvv as dtable WHERE
  primaryGenreName='Games') ORDER BY new_apps.top ASC, trackName ASC LIMIT 12
  </code></pre>
  
  <p>with that query I get this error:</p>
  
  <pre><code>#1250 - Table 'new_apps' from one of the SELECTs cannot be used in global ORDER clause
  </code></pre>
  
  <p>new_apps is not used in the second query, the idea is to get first by top rank from the same table that has also listed the id in new_apps table</p>