【发布时间】:2012-09-21 09:55:25
【问题描述】:
我正在尝试在我的 sql 数据库中创建一个表,该表有几个不同的 int 列、名称和其他一些东西。但是有两个表我想在其中存储货币值。不超过 3 位,两个显示时的小数位。
这是我写的sql
CREATE TABLE `5050goose` (
`goose_id` int(11) unsigned NOT NULL auto_increment,
`name` varchar(100) NOT NULL default '',
`width` int(8),
`height` int(8),
`normal_fill` int(8),
`our_fill` int(8),
`old_price` smallmoney(8),
`price` smallmoney(8),
PRIMARY KEY (`goose_id`)
) TYPE=MyISAM;
但是当我执行这个时,我得到了这个错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'smallmoney(8),
`price` smallmoney(8),
PRIMARY KEY (`goosedown_id`)
) TYPE' at line 8
这清楚地表明 smallmoney 对我不起作用。所以我想知道如何在我的 sql 数据库中存储货币价值。
【问题讨论】: