SEE Here for MYSQL Numeric Data Types
I'll recommend BIGINT
but be aware that the maximum value for BIGINT
is 9223372036854775807
. Make sure you can handle the value from OverFlow
ing
mysql> SELECT (9223372036854775807 + 1) as Result;
+-------------------------+
| Result |
+-------------------------+
| -9223372036854775808 |
+-------------------------+
in order to enable the operation to succeed in this case, convert the value to unsigned;
mysql> SELECT (CAST(9223372036854775807 AS UNSIGNED) + 1) as Result;
+-------------------------------------------+
| Result |
+-------------------------------------------+
| 9223372036854775808 |
+-------------------------------------------+