title: select * where id in (....) and all columX are equal
body: <p>Hej folks,</p>
  
  <p>i have to deal with a special problem. First this is the simplified table:</p>
  
  <pre><code> id | A | B
  -------------
    1 | a | 1
    2 | b | 2
    3 | c | 1
    4 | d | 1
    5 | e | 3
    6 | f | 1
    7 | g | 2
  </code></pre>
  
  <p>thanks to a quite lame API I get a list of required ids like</p>
  
  <pre><code>(1,2,3,5,6)
  </code></pre>
  
  <p>BUT, out of this list i have to select only the rows with a specific <em>unknown</em> value in column B. In this example the unknown value would be 1 since the first matched id has a 1 in column B. </p>
  
  <p>As a result I would need the rows </p>
  
  <pre><code>1, 3, 4, 6
  </code></pre>
  
  <p>because the <em>required</em> row 2 and 6 have different values in column B.</p>
  
  <p>I hope you can follow so far.</p>
  
  <p>The problem is already solved by filtering the result inside the software but i wonder if there is a solution with pure SQL?</p>
  
  <p>The DB is MySQL and i have no chance to change the tables or the API since this a plugin to existing software :(</p>
  
  <p>Thanks in advance! I guess its impossible but to be true my SQL skills are not the best.</p>
  
  <p>P.S.</p>
  
  <p>if the requested ids would be this:</p>
  
  <pre><code> (2,3,5,6,7)
  </code></pre>
  
  <p>the result must be:</p>
  
  <pre><code>(2, 7)
  </code></pre>
  
  <p>because the first fetched value for column B is "2"</p>