BIGINT
Large integer type. A BIGINT uses 8 bytes and can store values from -9223372036854775808 to 9223372036854775807 (signed) or 0 to 18446744073709551615 (unsigned).
Syntax
BIGINT[(M)] [SIGNED | UNSIGNED | ZEROFILL]Description
BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUEEXAMPLES
With strict_mode set
CREATE TABLE bigints (a BIGINT,b BIGINT UNSIGNED,c BIGINT ZEROFILL);
INSERT INTO bigints VALUES (-10,-10,-10);
ERROR 1264 (22003): Out of range value for column 'b' at row 1
INSERT INTO bigints VALUES (-10,10,-10);
ERROR 1264 (22003): Out of range value for column 'c' at row 1
INSERT INTO bigints VALUES (-10,10,10);
INSERT INTO bigints VALUES (9223372036854775808,9223372036854775808,9223372036854775808);
ERROR 1264 (22003): Out of range value for column 'a' at row 1
INSERT INTO bigints VALUES (9223372036854775807,9223372036854775808,9223372036854775808);
SELECT * FROM bigints;
+---------------------+---------------------+----------------------+
| a | b | c |
+---------------------+---------------------+----------------------+
| -10 | 10 | 00000000000000000010 |
| 9223372036854775807 | 9223372036854775808 | 09223372036854775808 |
+---------------------+---------------------+----------------------+SIGNED and UNSIGNED
Out of Range
BIGINT ZEROFILL
See Also
Last updated
Was this helpful?

