title: SQL Server : how to do an inner join by various columns
body: <p>I have two tables, both <code>Table1</code> and <code>Table2</code>, share 4 columns named <code>C1, C2, C3 and C4</code>; those columns store a numerical sequence from 1 to 56; also, there can be not duplicated numbers in one row, and the numbers always go from lowest to highest. </p>
  
  <p>Example:</p>
  
  <p>Table1</p>
  
  <pre><code>C1 C2 C3 C4
   1  6 10 44
   5  7 23 50
  45 46 52 56
  </code></pre>
  
  <p>Now I have to check for sequences that appear in the two tables, but instead of a join on the four columns </p>
  
  <pre><code>select * 
  from table1 a 
  inner join table 2 on a.c1 = b.c1 and a.c2 = b.c2 and a.c3 = b.c3 and a.c4 = b.c4
  </code></pre>
  
  <p>is there another way to do it?</p>