title: sql get username twice in one query
body: <p>I have the following 3 tables:</p>
  
  <pre><code>users:
  id, username
  
  folders:
  id,fkuser(connects to user.id)
  
  folder_comments:
  id,fkuser(connects to user.id), fkfolder(connects to folder.id)
  </code></pre>
  
  <p>I want to get the commenter username(<code>folder_comments.fkuser-&gt;user.id&lt;-&gt;user.username</code>) <strong>AND</strong> and the username of the folder owner (<code>folder_comments.fkfolder-&gt;folder.id&lt;-&gt;folder.fkuser-&gt;user.id&lt;-&gt;user.username</code>);</p>
  
  <p>The query I have thoght of is partial:</p>
  
  <pre><code>SELECT `folder_comments`.*, `folder`.`fkuser` as folderuserid, `user`.`firstname` as username
  FROM `folder_comments` 
                  left join `folder` on `folder_comments`.`fkfolder` = `folder`.`id`
                  left join `user` on `folder_comments`.`userid` = `user`.`id`
  </code></pre>
  
  <p>How can I get the folder's owner username?</p>
  
  <p>edit :</p>
  
  <p>I tried:</p>
  
  <pre><code>    SELECT `folder_comments`.*, `folder`.`fkuser` as folderuserid, `user`.`firstname` as username, , `user`.`firstname` as folderowner
          FROM `folder_comments` 
                          left join `folder` on `folder_comments`.`fkfolder` = `folder`.`id`
                          left join `user` on `folder_comments`.`userid` = `user`.`id`
  left join `user` on `folder`.`fkuser` = `user`.`id`
  </code></pre>
  
  <p>but I get an error <code>Not unique table/alias: 'user'</code></p>