title: Why do I need aliases in self join?
body: <p>I'm learning SQL and happen to hang on a point that confuses me:</p>
  
  <p>I got 1 table with 1 column (boys.boy) while boy is a varchar.</p>
  
  <pre><code>SELECT boys.boy, boys.boy 
  FROM boys 
  LEFT JOIN boys 
    ON length(boy) &gt; length(boy)
  </code></pre>
  
  <p>Why am I unable to do this? Would this break some invariant, or why did the inventors explicitly bring in "self-joins"?</p>
  
  <p>In other words, this works ("self join"):</p>
  
  <pre><code>SELECT b1.boy, b2.boy 
  FROM boys AS b1 
  INNER JOIN boys AS b2 
    ON length(b1.boy) &gt; length(b2.boy)
  </code></pre>
  
  <p>The magic lies in the aliases (AS ...).</p>