title: Extract correct number of matching rows from two tables in SQL
body: <p>I have a problem for extracting the correct number of rows from my table1 wich are matching with my table2.</p>
  
  <p>Explanation :</p>
  
  <p>My first table "table1" is a list of Sample (for example):</p>
  
  <pre><code>    Patient ID    Visit        Typology       Date               Box
      01            V1           Plasma       11-10-2012            1
      01            V1           Plasma       11-10-2012            2
      01            V1           Plasma       11-10-2012            3
      01            V1           Urine        11-10-2012            4 
      01            V1           Urine        11-10-2012            5
      01            V1           Urine        11-10-2012            6
  
  </code></pre>
  
  <p>My second table "table2" contains sample I want to extract :</p>
  
  <pre><code>    Patient ID    Visit        Typology       Date              
      01            V1           Plasma       11-10-2012            
      01            V1           Plasma       11-10-2012            
      01            V1           Plasma       11-10-2012            
      01            V1           Urine        11-10-2012            
      01            V1           Urine        11-10-2012                     
  
  </code></pre>
  
  <p>So I want to extract the Box information from the table "table1" for samples which are matching.
  But the problem is that rows can match but I don't want all of it : I want only the firsts matching rows</p>
  
  <p>For example I wanted to extract the three sample of Plasma but only two of Urine.</p>
  
  <p>With a JOIN on the different rows I have all the mathing rows but I don't want the third 'Urine'</p>
  
  <p>Is there somebody to help me with this trouble ?</p>