Finding the max integer using MySQL.

Finding the max integer using MySQL.

am 21.04.2010 01:01:43 von Alister West

Hi there,

I would like to find out the maximum (signed or unsigned) integer from MySQL.

SELECT CAST( POW(2,100) as UNSIGNED) as max_int;
# max_int | 9223372036854775808

This seems to be a MAX_BIGINT from the lookup table at
http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html

Is there a way to get the MAX_INT ?
Is there a constant or a function I can use to get this?

I could do
SELECT @MAX_SIGNED := POW(2,31) -1 ;
but wondering if there is a built in way to do it.

I have tested the above on 2 machines.
Both linux. (5.0.83 on 64bit) and (5.1.37 on 32bit).

Cheers,

~~
c|_| Alister West - Saving the world from coffee!

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org