title: MySQL query selecting the least non-null, non-zero integer
body: <p>I have a table that has 5 columns: <code>uniqueid</code>, <code>int1</code>, <code>int2</code>, <code>int3</code>, and <code>FruitStand</code>. What I'm looking for is an example on how to do a single select that outputs the data of whichever column has the least non-null, non-zero integer.</p>
  
  <p>Example Table:</p>
  
  <pre><code>uniqueid|int1|int2|int3|FruitStand
  1       |   2|   3|   4|Apples
  2       |  21|   4|   0|Oranges
  3       |NULL|   2|   5|Pears
  </code></pre>
  
  <p>So I would get the results from this query of</p>
  
  <pre><code>1       |   2|Apples
  2       |   4|Oranges
  3       |   2|Pears
  </code></pre>