title: In SQL how do I get the maximum value for an integer?
body: <p>I am trying to find out the maximum value for an integer (signed or unsigned) from a MySQL database. Is there a way to pull back this information from the database itself?</p>
  
  <p>Are there any built-in constants or functions I can use (either standard SQL or MySQL specific).</p>
  
  <p>At <a href="http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html" rel="noreferrer">http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html</a> it lists the values - but is there a way for the database to tell me.</p>
  
  <p>The following gives me the MAX_BIGINT - what I'd like is the MAX_INT.</p>
  
  <pre><code>SELECT CAST( 99999999999999999999999 AS SIGNED ) as max_int;
  # max_int | 9223372036854775807
  </code></pre>