title: Duplicated results when performing INNER JOIN
body: <p>I have 2 simple tables that I would like to perform an INNER JOIN with, but the problem is that I'm getting duplicated (for the columns str1 and str2) results:</p>
  
  <pre><code>CREATE TABLE #A (Id INT, str1 nvarchar(50), str2 nvarchar(50))
  insert into #A  values (1, 'a', 'b')
  insert into #A  values (2, 'a', 'b')
  
  CREATE TABLE #B (Id INT, str1 nvarchar(50), str2 nvarchar(50))
  insert into #B values (7, 'a', 'b')
  insert into #B  values (8, 'a', 'b')
  
  select * from #A a
  INNER JOIN #B b ON a.str1 = b.str1 AND a.str2 = b.str2  
  </code></pre>
  
  <p>It gave me 4 records when I really wanted 2.</p>
  
  <p>What I got:<br>
  id | str1 |  str2| id |  str1 | str2<br>
  1  | a   |  b  |  7  |  a  |  b<br>
  2  | a   |  b  |  7  |  a  |  b<br>
  1  | a   |  b  |  8  |  a  |  b<br>
  2  | a   |  b  |  8  |  a  |  b</p>
  
  <p>What I really wanted:<br>
  1   a  |   b |   7 |   a  |  b<br>
  2   a  |   b |   8 |   a  |  b</p>
  
  <p>Can anyone help? I know this is achievable using a cursor and loop, but I'd like to avoid it and only use some type of JOIN if possible.</p>