In SQL how do I get the maximum value for an integer?
- by CoffeeMonster
Hi,
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?
Are there any built-in constants or functions I can use (either standard SQL or MySQL specific).
At http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html it lists the values - but is there a way for the database to tell me.
The following gives me the MAX_BIGINT - what I'd like is the MAX_INT.
SELECT CAST( 99999999999999999999999 AS SIGNED ) as max_int;
# max_int | 9223372036854775807
Thanks in advance,