title: Select from multiple tables where one has distinct values
body: <p>I have a simple problem here using SQL views. I just can't seem to figure it out at the moment.</p>
  
  <ul>
  <li>I have 2 tables, TableA and TableB.</li>
  <li>I want to retrieve FieldA in TableA
  and FieldB in TableB.</li>
  <li>The two tables are linked using an
  INNER JOIN.</li>
  <li>I only want rows where TableA.FieldA
  are distinct.</li>
  <li>The returned values should be of the top 10 items from TableB.FieldB</li>
  </ul>
  
  <p>Simply using SELECT DISTINCT seems to be using the combination of the two fields to determine distinction.</p>
  
  <p>Any ideas?</p>
  
  <p>Here is a mock of the SQL currently returning all rows :</p>
  
  <pre><code>SELECT dbo.TableA.FieldA, dbo.TableB.FieldB
  FROM dbo.TableA INNER JOIN dbo.TableB ON dbo.TableA.ID = dbo.TableB.TableAID
  </code></pre>
  
  <p>An example of data returned from this standard query would be :</p>
  
  <pre><code>FieldA  FieldB
  John    78
  John    21
  Claire  18
  Sam     16
  John    25
  Claire  48
  Paul    53
  </code></pre>
  
  <p>What I am looking to have returned from the query would be : </p>
  
  <pre><code>John    78
  Paul    53
  Claire  48
  Sam     16
  </code></pre>
  
  <p>**EDITED to try and make things a bit clearer and include missing information.</p>