title: Comparing Multiple Columns with and without NULL values
body: <p>5, Not sure what am I doing wrong, please help. As it seems in a query on multiple column comparison to find least value, 
  NULL continues to show up as a Resultant instead of least value </p>
  
  <pre><code>SELECT
    IF(col1 IS NULL OR col2 IS NULL OR col3 IS NULL OR col4 IS NULL OR col5 IS NULL, 
        COALESCE(col1,col2,col3,col4,col5), 
        LEAST(col1,col2,col3,col4,col5)
    ) As Resultant 
  from db.tablename 
  Group by Id;
  </code></pre>
  
  <p>Alternatively tried CASE select without much success. 
  Thanks</p>