title: update with max function
body: <p>I have 3 columns which are in use right now in the table. 1st is max amount one can use, 2nd is the amount one has used. Now, I want the 3rd column to be the max(1st-2nd,0). </p>
  
  <p>I am using <code>update my_table set availability = max(1st-2nd,0) where type = 'bill';</code> </p>
  
  <p>But in a procedure, it is not possible. The main thing is I don't want negative value and I want 0 instead of it. How can I do that.</p>