title: Inner join of 2 tables with the same ID
body: <p>I have a table(<code>T1</code>) in which 2 columns(<code>X</code> and <code>Y</code>) are id's. The name's of these corresponding <code>id</code>'s are in another table (<code>T2</code>) with the column <code>name</code>.</p>
  
  <p>Suppose I was only using <code>X</code> then, a simple Inner join would have solved my problem in getting the name.</p>
  
  <p>Such as </p>
  
  <pre><code>Select T1.somedata,T1.somedata1,T2.name from T1
  Inner Join T2 ON T1.X=T2.id
  </code></pre>
  
  <p>But,what if I want the name's to be resolved for the <code>T1.Y</code> also?, which <code>name</code> would the Inner Join resolve it to ??</p>
  
  <pre><code>Select T1.somedata,T1.somedata1,T2.name from T1
  Inner Join T2 ON T1.X=T2.id
  Inner Join T2 ON T1.Y=T2.id
  </code></pre>
  
  <p>The above query is wrong, I know. Can I get the <code>name</code>s of those corresponding to both <code>T1.X</code>and <code>T1.Y</code> with an <code>INNER Join</code>?</p>
  
  <p>-Beginner</p>