title: SQL: Finding where value appears more than once
body: <p>I'm trying to find records where "subfield a" appears more than once.</p>
  
  <p>This query works great for finding rows that have any subfield a at all:</p>
  
  <pre><code>SELECT Distinct 
      BT.BibliographicRecordID as recordid
  FROM 
      BibliographicTags BT with (nolock)
  JOIN 
      BibliographicSubfields BS with (nolock) ON BS.BibliographicTagID = BT.BibliographicTagID
  WHERE 
      BT.TagNumber = 049
      AND BS.subfield ='a' 
  </code></pre>
  
  <p>But I'm trying for something with the effect of:</p>
  
  <pre><code>SELECT Distinct 
      BT.BibliographicRecordID as recordid
  FROM 
      BibliographicTags BT with (nolock)
  JOIN 
      BibliographicSubfields BS with (nolock) ON BS.BibliographicTagID = BT.BibliographicTagID
  WHERE 
      BT.TagNumber = 049
      AND BS.subfield = 'a' APPEARS MORE THAN ONCE
  </code></pre>
  
  <p>Thank you!</p>