numeric-types.md 2.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
## 11.1 数字数据类型


[11.1.1 数值数据类型语法](numeric-type-syntax.html)

[11.1.2 整数类型(精确值) - INTEGER、INT、SMALLINT、TINYINT、MEDIUMINT、BIGINT](integer-types.html)

[11.1.3 定点类型(精确值)——DECIMAL、NUMERIC](fixed-point-types.html)

[11.1.4 浮点类型(近似值)——FLOAT、DOUBLE](floating-point-types.html)

[11.1.5 位值类型——BIT](bit-type.html)

[11.1.6 数值类型属性](numeric-type-attributes.html)

[11.1.7 超出范围和溢出处理](out-of-range-and-overflow.html)

[](<>)[](<>)[](<>)

MySQL 支持所有标准 SQL 数字数据类型。这些类型包括确切的数字数据类型([`整数`](integer-types.html),[`小灵通`](integer-types.html),[`十进制`](fixed-point-types.html), 和[`数字`](fixed-point-types.html)),以及近似数值数据类型 ([`漂浮`](floating-point-types.html),[`真实的`](floating-point-types.html), 和[`双精度`](floating-point-types.html))。关键字[`INT`](integer-types.html)是同义词[`整数`](integer-types.html), 和关键字[`十二月`](fixed-point-types.html)[`固定的`](fixed-point-types.html)是同义词[`十进制`](fixed-point-types.html).MySQL 对待[`双倍的`](floating-point-types.html)作为同义词[`双精度`](floating-point-types.html)(非标准扩展)。MySQL 也处理[`真实的`](floating-point-types.html)作为同义词[`双精度`](floating-point-types.html)(非标准变体),除非[`REAL_AS_FLOAT`](sql-mode.html#sqlmode_real_as_float)SQL 模式已启用。

[`少量`](bit-type.html)数据类型存储位值并支持[`MyISAM`](myisam-storage-engine.html),[`记忆`](memory-storage-engine.html),[`InnoDB`](innodb-storage-engine.html), 和[`新开发银行`](mysql-cluster.html)表。

有关 MySQL 如何在表达式评估期间处理将超出范围的值分配给列和溢出的信息,请参阅[第 11.1.7 节,“超出范围和溢出处理”](out-of-range-and-overflow.html).

有关数值数据类型的存储要求的信息,请参阅[第 11.7 节,“数据类型存储要求”](storage-requirements.html).

有关对数值进行操作的函数的描述,请参见[第 12.6 节,“数值函数和运算符”](numeric-functions.html).用于数值操作数计算结果的数据类型取决于操作数的类型和对它们执行的操作。有关详细信息,请参阅[第 12.6.1 节,“算术运算符”](arithmetic-functions.html).