title: Mysql Subquery Syntax
body: <p>I'm wondering why statements like <code>select * as t</code> appear in mysql subqueries like the following.</p>
  
  <p>The following deletes the oldest 3 rows in a table according to a <code>created_time</code> column.</p>
  
  <p>Why is this right</p>
  
  <pre><code>DELETE FROM mytable WHERE id = ANY 
  ( SELECT * FROM ( SELECT id FROM mytable ORDER BY created_time ASC LIMIT 3')as t)
  </code></pre>
  
  <p>and not</p>
  
  <pre><code>DELETE FROM mytable WHERE id = ANY 
  (SELECT id FROM mytable ORDER BY created_time ASC LIMIT 3) 
  </code></pre>
  
  <p>?</p>
  
  <p>To me, the second form makes sense. It doesn't work and I'd like to understand why the first is necessary. Specifically, what is <code>t</code> and what does <code>as t</code> do?</p>