title: MySQL Where IS NOT ALL NULL?
body: <p>How can a query with ability to verify all selected records are not null?
  For example with the following query,
  verify all rows with field <code>is_field_null</code> is not <code>NULL</code> from returned <code>level1</code>? </p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM (
  SELECT tb_a.A, tb_b.is_field_null FROM tb_a, tb_b, tb_c
  WHERE tb_a.a = "some" AND tb_a.b = "thing" AND tb_c.c = "else"
  AND tb_a.b = tb_b.a
  AND tb_c.b = tb_b.c
  ) AS level1
  </code></pre>
  
  <p>Suppose there are some rows with <code>is_field_null</code> in <code>level1</code> are indeed <code>NULL</code> and the tables are</p>
  
  <p>tb_a</p>
  
  <pre><code>a          |    b        |      A
  ------------------------------------------
  "some"     | "thing"     | "XXX"
  "some"     | "thing"     | "YYY"
  </code></pre>
  
  <p>tb_b</p>
  
  <pre><code>a            | c           | is_field_null 
  ----------------------------------------------
  "thing"       | "else"      | "I have things here" 
  "thing"       | "else"      | NULL
  </code></pre>
  
  <p>tb_c</p>
  
  <pre><code>b            | c           | mapper 
  ----------------------------------------------
  "else"       | "else"      | "ZZZ" 
  "else"       | "else"      | "KKK"
  </code></pre>
  
  <p>I have tried the following which it returns some row(s) with <code>is_field_null</code> is not null. E.g.</p>
  
  <pre class="lang-sql prettyprint-override"><code>A        |     is_field_null
  -----------------------------
  "XXX"    | "I have things here"
  "YYY"    | "I have things here"
  </code></pre>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM (
  SELECT tb_a.A, tb_b.is_field_null FROM tb_a, tb_b, tb_c
  WHERE tb_a.a = "some" AND tb_a.b = "thing" AND tb_c.c = "else"
  AND tb_a.b = tb_b.a
  AND tb_c.b = tb_b.c
  ) AS level1
  WHERE level1.is_field_null IS NOT NULL
  </code></pre>
  
  <p>I would expect an empty table. How can I do it? </p>
  
  <p>E.g.</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM (
  SELECT tb_a.A, tb_b.is_field_null FROM tb_a, tb_b, tb_c
  WHERE tb_a.a = "some" AND tb_a.b = "thing" AND tb_c.c = "else"
  AND tb_a.b = tb_b.a
  AND tb_c.b = tb_b.c
  ) AS level1
  WHERE level1.is_field_null IS NOT ALL NULL ??
  
  </code></pre>