title: SQL - Finding common rows based on a column (intersect)
body: <p>Given the following table:</p>
  
  <p><strong>InstalledApps</strong></p>
  
  <pre><code>MachineName | AppName | Version
  -------------------------------
  machine01   | App01   | 1.1
  machine01   | App02   | 1.0
  machine01   | App03   | 1.5
  machine02   | App04   | 2.0
  machine02   | App02   | 1.0
  machine02   | App01   | 1.1
  machine03   | App06   | 7.9.9
  machine03   | App01   | 1.1
  machine03   | App07   | 11.5
  machine03   | App02   | 1.0
  </code></pre>
  
  <p>I need to select <code>Apps</code> which are common to given "n" machines. It's an intersect between "n" sets. However, I'm having a hard time coming up with a decent query.</p>
  
  <p>I know that I can do something like this:</p>
  
  <pre><code>SELECT AppName, Version 
  FROM InstalledApps 
  WHERE MachineName = 'machine01'
  
  INTERSECT
  
  SELECT AppName, Version 
  FROM InstalledApps 
  WHERE MachineName = 'machine02' 
  </code></pre>
  
  <p>That will give me </p>
  
  <pre><code>AppName | Version
  ------------------
  App01   | 1.1
  App02   | 1.0
  </code></pre>
  
  <p>However, is there a way I can do it without having to know the number of machines upfront? Something like  </p>
  
  <pre><code>SELECT...... 
  FROM InstalledApps 
  WHERE MachineName IN ('machine01',...'machine99')
  </code></pre>