title: Finding whether duplicates exists in 2 select statements
body: <p>Could you please help me with SQL statement to find duplicate names present in first Select statement and the second.</p>
  <p>For example :
  I need to find whether student with same name in Class 1 is present or not in Class 2 or 3.</p>
  <pre><code>select firstname from College where classid = 1
  </code></pre>
  <p>and Second select statement is :</p>
  <pre><code>select firstname from College where classid in (2, 3)
  </code></pre>
  <p>If there is matching occurrences for any name then I want to select that record.</p>