title: SQL filter one table on every row of another
body: <p>I have a table, A:</p>
  
  <pre><code>|Id|alias  |
  ------------
  |1 |alice  |
  |2 |alice  |
  |2 |bob    |
  |3 |alice  |
  |3 |bob    |
  |3 |charlie|
  </code></pre>
  
  <p>I have another table, N:</p>
  
  <pre><code>|name |
  -------
  |alice|
  |bob  |
  </code></pre>
  
  <p>I am looking for a query to return all of the Ids in the first table with <em>both</em> the aliases in the second table.  In this example, I want to see</p>
  
  <pre><code>`(2, 3)`
  </code></pre>
  
  <p>I can't use a simple join</p>
  
  <pre><code>select Id
    from A
      join N on A.alias = B.name
  </code></pre>
  
  <p>Every record in A has alice, so this query returns 1, which is not what I want.  I am having trouble thinking of a syntax that does this kind of thing.  Suggestions?  I am using TSQL and Sql Server, if it makes a difference.</p>
  
  <p>TIA</p>