title: Calculating average speed from columns that have both a distance and a time (NULL issues)
body: <p>I have two columns in a MySQL database.  One is a distance column, and the other is a time column.  In some cases one or both of these values is not known, and thus, NULL.  I want to create a query that finds the average speed, excluding any null entries.</p>
  
  <p>For instance:</p>
  
  <pre><code>Distance    Time
  
  60          60
  120         60
  NULL        45
  30          NULL
  NULL        NULL
  </code></pre>
  
  <p>The computed average speed should be <code>(60+120)/(60+60) = 1.5</code></p>
  
  <p>Thanks!</p>