title: Changing IN to EXISTS in SQL
body: <p>I have the following query:</p>
  
  <pre><code>select A,
         B 
    from table1 
   where A in (select c 
                 from table 2
              )
  </code></pre>
  
  <p>But, now I need to change this query and use <code>exists</code> instead of <code>in</code>, and it should give the same results.</p>
  
  <p>My tables look like the following:</p>
  
  <pre><code>table1            table2
  A    B               c
  ------             -----
  1    x               1
  2    y               3
  3    z               4
  4    w               7
  5    a
  1    b
  </code></pre>
  
  <p>How do I use the <code>exists</code> function?</p>