码迷,mamicode.com
首页 > 其他好文 > 详细

DECIMAL Data Type

时间:2016-06-27 01:31:01      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

In MySQL, DECIMAL(M,D) and NUMERIC(M,D) are the same, and both have a precision of exactly M digits.

Leftover Digits    Number of Bytes
0             0
12            1
34            2
56            3
79            4

 For example,

DECIMAL(18,9) column has nine digits on either side of the decimal point, so the integer part and the fractional part each require 4 bytes.

DECIMAL(20,6) column has fourteen integer digits and six fractional digits.

The integer digits require four bytes for nine of the digits and 3 bytes for the remaining five digits.

The six fractional digits require 3 bytes.

DECIMAL Data Type

标签:

原文地址:http://www.cnblogs.com/zengkefu/p/5618994.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!