![]() ![]() ![]() |
Ispirer SQLWays Database Migration Software
DECIMAL, DEC and NUMERIC
DECIMAL[(p[,s])] [UNSIGNED]
An unpacked floating-point number. DECIMAL is stored as a string, using one character for each digit of the value.
The p specifies the total number of the digits not including the decimal point and, the `-' sign. Prior to MySQL Version 3.23, the p argument must include the space needed for the sign and the decimal point.
The s specifies the number of digits following the decimal point.
The maximum range of DECIMAL values is the same as for DOUBLE, but the actual range for a given DECIMAL column may be constrained by the choice of p and s.
If p is omitted, the default is 10.
If s is omitted, the default is 0, that is, values will have no decimal point or fractional part.
If UNSIGNED is specified, negative values are not allowed.
DEC[(p[,s])] [UNSIGNED]
NUMERIC[(p[,s])] [UNSIGNED]
These are synonyms for DECIMAL. DEC data type is available since MySQL version 4.00.
![]() ![]() ![]() |