title: Order by result of a query / Mysql Subquery
body: <p>Hi there (I'm new to PHP),</p>
  
  <p>I can't quite figure out the syntax of a subquery I'm trying to make, this is the query:</p>
  
  <pre><code>SELECT * FROM show_episode, shows, show_episode_airdate, show_moyenne 
  WHERE season = 1 AND episode = 1 
  AND shows.imdb_id = show_episode.imdb_id_show 
  AND show_episode_airdate.episode_id = show_episode.episode_id 
  AND show_moyenne.show_id = shows.id 
  AND show_episode_airdate.airdate &lt; '2013-07-12' 
  ORDER BY show_episode_airdate.airdate DESC LIMIT 10
  </code></pre>
  
  <p>Once this was done, I wanted to order those 10 selected rows by show_moyenne.moyenne with something like that:</p>
  
  <pre><code>SELECT * (FROM show_episode, shows, show_episode_airdate, show_moyenne 
  WHERE season = 1 AND episode = 1 
  AND shows.imdb_id = show_episode.imdb_id_show 
  AND show_episode_airdate.episode_id = show_episode.episode_id 
  AND show_moyenne.show_id = shows.id 
  AND show_episode_airdate.airdate &lt; '2013-07-12' 
  ORDER BY show_episode_airdate.airdate DESC LIMIT 10) 
  * ORDER BY show_moyenne.moyenne DESC
  </code></pre>
  
  <p>Which is not correct, anybody can show me the right way to do this ?</p>
  
  <p>Thanks, any help appreciated!</p>