- 13.1.1 数值数据类型语法13.1.1 Numeric Data Type Syntax
- 13.1.2 整数类型(精确值) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT
- 13.1.3 定点类型(精确值) - DECIMAL, NUMERIC13.1.3 Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC
- 13.1.4 浮点类型(近似值) - FLOAT, DOUBLE13.1.4 Floating-Point Types (Approximate Value) - FLOAT, DOUBLE
- 13.1.5 位值类型 - BIT13.1.5 Bit-Value Type - BIT
- 13.1.6 数值类型属性13.1.6 Numeric Type Attributes
- 13.1.7 超出范围和溢出处理13.1.7 Out-of-Range and Overflow Handling
MySQL supports all standard SQL numeric data types. These types
include the exact numeric data types
(INTEGER,
SMALLINT,
DECIMAL,以及NUMERIC), as well as the
approximate numeric data types
(FLOAT,
REAL,以及DOUBLE PRECISION). The keyword
INT is a synonym for
INTEGER, and the keywords
DEC以及FIXED are synonyms for
DECIMAL. MySQL treats
DOUBLE as a synonym for
DOUBLE PRECISION (a nonstandard
extension). MySQL also treats REAL
as a synonym for DOUBLE PRECISION
(a nonstandard variation), unless the
REAL_AS_FLOAT SQL mode is
enabled.MySQL supports all standard SQL numeric data types. These types
include the exact numeric data types
(INTEGER,
SMALLINT,
DECIMAL, and
NUMERIC), as well as the
approximate numeric data types
(FLOAT,
REAL, and
DOUBLE PRECISION). The keyword
INT is a synonym for
INTEGER, and the keywords
DEC and
FIXED are synonyms for
DECIMAL. MySQL treats
DOUBLE as a synonym for
DOUBLE PRECISION (a nonstandard
extension). MySQL also treats REAL
as a synonym for DOUBLE PRECISION
(a nonstandard variation), unless the
REAL_AS_FLOAT SQL mode is
enabled.
BIT 数据类型存储比特值,并且支持用于 MyISAM、MEMORY、InnoDB 以及 NDB 表。The BIT data type stores bit values
and is supported for MyISAM,
MEMORY,
InnoDB, and
NDB tables.
有关 MySQL 如何处理列的超出范围值分配以及表达式计算期间的溢出,请参见 第 13.1.7 节,“超出范围和溢出处理”。For information about how MySQL handles assignment of out-of-range values to columns and overflow during expression evaluation, see Section 13.1.7, “Out-of-Range and Overflow Handling”.
有关数值数据类型存储要求的信息,请参见 第 13.7 节,“数据类型存储要求”。For information about storage requirements of the numeric data types, see Section 13.7, “Data Type Storage Requirements”.
有关对数值进行操作的函数的描述,请参见 第 14.6 节,“数值函数和运算符”。对数值操作数进行计算时使用的数据类型取决于操作数的类型以及对它们执行的操作。如需更多信息,请参见 第 14.6.1 节,“算术运算符”。For descriptions of functions that operate on numeric values, see Section 14.6, “Numeric Functions and Operators”. The data type used for the result of a calculation on numeric operands depends on the types of the operands and the operations performed on them. For more information, see Section 14.6.1, “Arithmetic Operators”.