title: SQL Query in finding out the max number from a table with Null value
body: <p>How Can I work out this requirement. Please help.  </p>
  
  <p>Client Table -  <strong>CT</strong>  </p>
  
  <pre><code>ClientID      Balance  
  123             10
  123             20  
  123             30
  123             40  
  124             50
  124             60  
  124             Null  
  </code></pre>
  
  <p>I want to find our the max(Balance) from the CT Table.<br>
  Condition - > If there is no null value then I have to find out max(Balance) otherwise It should be Null. See below result, that am expecting.  </p>
  
  <pre><code>ClientID     Balance  
  123           40  
  124           Null
  </code></pre>
  
  <p>Am writing the query as below. But Is there any more dynamic way to do?  </p>
  
  <pre><code>Select ClientID,  
         CASE WHEN MIN(Balance) = NULL THEN  
                   NULL  
               ELSE  
                   MAX(Balance) END AS 'MaxBalance'  
  From CT  
  Group by clientID  
  </code></pre>
  
  <p>Please let me know, is there any otheralternative?</p>