日期:2014-05-16  浏览次数:21177 次

[急]在导入decimal时为什么会是负数(-8446744056209541515)
create   database   if   not   exists   `mo`;

USE   `mo`;

/*数据表   `date`   的表结构*/

DROP   TABLE   IF   EXISTS   `date`;

CREATE   TABLE   `date`   (
    `ID`   int(10)   unsigned   NOT   NULL   auto_increment,
    `Date`   date   NOT   NULL   default   '0000-00-00 ',
    `NewDate`   timestamp(14)   NOT   NULL,
    `Str`   decimal(45,0)   NOT   NULL   default   '345 ',
    PRIMARY   KEY     (`ID`)
)   TYPE=MyISAM;

/*数据表   `date`   的数据*/

insert   into   `date`   values  

(12, '0000-00-00 ',20070402112232,10000000017500020102),

(11, '0000-00-00 ',20070325032406,10000000017500010101),

(14, '0000-00-00 ',00000000000000,10000000017500010101),

(15, '0000-00-00 ',00000000000000,10000000017500010101),

(16, '0000-00-00 ',00000000000000,10000000017500010101);

------解决方案--------------------
超出Decimal能表达的数值范围了!
------解决方案--------------------
奇怪,我这里很好呀

mysql> select * from date;
+----+------------+---------------------+----------------------+
| ID | Date | NewDate | Str |
+----+------------+---------------------+----------------------+
| 12 | 0000-00-00 | 2007-04-02 11:22:32 | 10000000017500020102 |
| 11 | 0000-00-00 | 2007-03-25 03:24:06 | 10000000017500010101 |
| 14 | 0000-00-00 | 0000-00-00 00:00:00 | 10000000017500010101 |
| 15 | 0000-00-00 | 0000-00-00 00:00:00 | 10000000017500010101 |
| 16 | 0000-00-00 | 0000-00-00 00:00:00 | 10000000017500010101 |
+----+------------+---------------------+----------------------+