title: Semijoin expression must be a part of logical AND
body: <p>I have a table (we can call it "A") with some fields (model:string, age:integer, code1:integer, code2:integer, code3:integer) and another table (it can be "codes") with classified codes (code:integer,codetype:string,description:string).</p>
  
  <p>That field codetype is there in order to group codes. For example, codes between 200 and 300 are brown. And every item can have up to 3 codes.</p>
  
  <p>Now, I just want to get that simple, simple query:</p>
  
  <pre><code>SELECT model,age FROM dataset.A
  WHERE code1 IN (SELECT code FROM dataset.codes WHERE codetype='brown')
  </code></pre>
  
  <p>and it works, except the fact, there are two other ones. So, if I do in this way:</p>
  
  <pre><code>SELECT model,age FROM dataset.A
  WHERE code1 IN (SELECT code FROM dataset.codes WHERE codetype='brown')
  OR code2 IN (SELECT code FROM dataset.codes WHERE codetype='brown')
  OR code3 IN (SELECT code FROM dataset.codes WHERE codetype='brown')
  </code></pre>
  
  <p>it doesn't work and I get this error message:</p>
  
  <pre><code>Error: (xx:yy): Semijoin expression (i.e. "x IN (SELECT ...)") must be a part of logical AND.
  </code></pre>
  
  <p>I am sure Google should have a way to do this. </p>
  
  <p>By the way, the project I am developing is not with "A" and "codes". I really need a solution for this. Thanks any help.</p>