Oracle 5.0 Reference Manual page 856

Table of Contents

Advertisement

0 to 23 results in a 4-byte single-precision
double-precision
MySQL permits a nonstandard syntax:
Here, "(M,D)" means than values can be stored with up to
after the decimal point. For example, a column defined as
when displayed. MySQL performs rounding when storing values, so if you insert
FLOAT(7,4)
Because floating-point values are approximate and not stored as exact values, attempts to treat them
as exact in comparisons may lead to problems. They are also subject to platform or implementation
dependencies. For more information, see
For maximum portability, code requiring storage of approximate numeric data values should use
or
DOUBLE PRECISION
11.1.4.4. Bit-Value Type -
As of MySQL 5.0.3, the
storage of M-bit values.
To specify bit values,
ones. For example,
"Bit-Field
Literals".
If you assign a value to a
with zeros. For example, assigning a value of
assigning b'000101'.
11.1.4.5. Numeric Type Attributes
MySQL supports an extension for optionally specifying the display width of integer data types in
parentheses following the base keyword for the type. For example,
display width of four digits. This optional display width may be used by applications to display integer
values having a width less than the width specified for the column by left-padding them with spaces.
(That is, this width is present in the metadata returned with result sets. Whether it is used or not is up to
the application.)
The display width does not constrain the range of values that can be stored in the column. Nor does
it prevent values wider than the column display width from being displayed correctly. For example, a
column specified as
outside the range permitted by three digits are displayed in full using more than three digits.
When used in conjunction with the optional (nonstandard) attribute ZEROFILL, the default padding of
spaces is replaced with zeros. For example, for a column declared as
is retrieved as 0005.
All integer types can have an optional (nonstandard) attribute UNSIGNED. Unsigned type can be used
to permit only nonnegative numbers in a column or when you need a larger upper numeric range for
the column. For example, if an
but its endpoints shift from
column.
DOUBLE
column, the approximate result is 999.0001.
with no specification of precision or number of digits.
BIT
data type is used to store bit-field values. A type of
BIT
can range from 1 to 64.
M
notation can be used.
b'value'
and
b'111'
b'10000000'
column that is less than
BIT(M)
has the usual
SMALLINT(3)
Note
The
attribute is ignored when a column is involved in expressions or
ZEROFILL
queries.
UNION
If you store values larger than the display width in an integer column that has
the
attribute, you may experience problems when MySQL generates
ZEROFILL
temporary tables for some complicated joins. In these cases, MySQL assumes
that the data values fit within the column display width.
column is UNSIGNED, the size of the column's range is the same
INT
-2147483648
Numeric Types
column. A precision from 24 to 53 results in an 8-byte
FLOAT
or
FLOAT(M,D)
REAL(M,D)
M
FLOAT(7,4)
Section C.5.5.8, "Problems with Floating-Point Values"
value
represent 7 and 128, respectively. See
bits long, the value is padded on the left
M
to a
b'101'
BIT(6)
SMALLINT
and
2147483647
836
or
DOUBLE
PRECISION(M,D).
digits in total, of which
will look like
999.00009
BIT(M)
is a binary value written using zeros and
column is, in effect, the same as
specifies an
INT(4)
range of
to 32767, and values
-32768
ZEROFILL, a value of
INT(4)
up to
and 4294967295.
0
digits may be
D
-999.9999
into a
FLOAT
enables
Section 9.1.6,
with a
INT
5

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents