title: Mysql minimum function
body: <p>Is there a predefined MySQL function that returns minimum<br> of its arguments' values (MINIMUM(1,16) -> 1)?</p>
  
  <p>To be more specific, I have a time-on-site column in one of my mysql tables.<br>
  Every visitor polls my server every 30 sec making an update:</p>
  
  <pre><code>UPDATE `mytable` SET `lastUpdate` = NOW() WHERE `id` = ?;
  </code></pre>
  
  <p>but I'd like to update also timeOnSite column like this:</p>
  
  <pre><code>UPDATE `mytable` SET `timeOnSite` = (
  `timeOnSite` + MINIMUM( 
                     TIMESTAMPDIFF(SECOND, lastUpdate, NOW()), 30
                 )
   ),
  `lastUpdate` = NOW() WHERE `id` = ?;
  </code></pre>
  
  <p>But the problem is that there are no such MINIMUM function, and I failed to find it in MySQL manuals.</p>