title: MySQL - Sum only if all rows are not null, else return null
body: <p>Let's suppose the following table:</p>
  
  <pre><code> X   VALUE
   1   2
   1   3
   2   NULL
   2   4
  </code></pre>
  
  <p>I want a result set grouped by X with the sum of VALUE, but only if all the rows related to each X value are not null.</p>
  
  <p>Using the same example, the result must be:</p>
  
  <pre><code>X   SUM(VALUE)
  1   5
  </code></pre>
  
  <p>As you can see, <code>X=2</code> is not selected due to the <code>(2, NULL)</code> tuple.</p>
  
  <p>I want, whenever this is possible, without using subqueries.</p>
  
  <p>Thank you very much!</p>