title: Inner join on multiple columns in SQL Server
body: <p>I have two tables</p>
  
  <ul>
  <li>tbltask</li>
  <li>tbluser</li>
  </ul>
  
  <p>In <code>tbluser</code> I have two columns, <code>userid</code> and <code>username</code></p>
  
  <p>Sample data:</p>
  
  <pre><code>1     ibrahim
  2     nizam
  3     shahrukh
  4      saddam
  </code></pre>
  
  <p>and in my second table, I have multiple tasks</p>
  
  <pre><code>taskid   userid   assignby   assignto
  -------------------------------------
  1         4           4          2
  </code></pre>
  
  <p>Here saddam assigned a task to nizam</p>
  
  <pre><code>2         3           3          1
  </code></pre>
  
  <p>Here shahrukh assigned a task to ibrahim</p>
  
  <p>I have a select command like</p>
  
  <pre><code>select userid, assignby, assignto from tbltask where taskid='1'
  </code></pre>
  
  <p>and i am getting this </p>
  
  <pre><code>3        3          1
  </code></pre>
  
  <p>now i want to join the table, because instead of i, i want username to be displayed</p>
  
  <p>so answer which i want to display will be</p>
  
  <pre><code>shahrukh shahrukh ibrahim
  </code></pre>
  
  <p>how i can join the table?</p>