title: SQL Selecting MIN value from row data with null values
body: <p>My table in Oracle is like this</p>
  
  <pre><code>Col   Col1  Col2  Col3  ColR
  --   ----  ----   ----  ---- 
  30    73    40    null  -10
  60    32    null  20     40
  90    80    null  null   10
  80    45    81    30     50
  </code></pre>
  
  <p>I can also set 0 instead of null in the above column.
  I need to find the min value from Col1,Col2,Col3 ignoring null or 0 and populate the ColR by subtracting from Col. </p>
  
  <p>EDIT: 
  i wrote a CASE statement which doesn't work due to the null values inside my table.</p>
  
  <pre><code> SELECT col,col1,col2,col3,
    CASE
      WHEN Col1 &lt; Col2 AND Col1  &lt; Col3
      THEN Col - Col1
      WHEN Col2 &lt; Col1 AND Col2  &lt; Col3
      THEN Col - Col2
      ELSE Col - Col3
    END ColR
  FROM
   (SELECT col,col1,
     CASE
      WHEN col22 IS NULL
      THEN NULL( i can also SET TO 0 but it will mess  WITH my other calculation TO find MIN)
        ELSE ROUND( 100* ( (col22) / (col44)))
      END col2 ,
      CASE
        WHEN col33 IS NULL
        THEN NULL
        ELSE ROUND( 100* ( (col33) / (col44)))
      END col3
    FROM TABLE
    )
  </code></pre>
  
  <p>I have just included the case statement inside my select query. all the the column values all populated from another query. </p>