Mysql sql货币栏

Mysql sql货币栏,mysql,sql,Mysql,Sql,可能重复: 我正在尝试在我的sql db中创建一个表,该表包含几个不同的int列、名称和其他内容。。但有两张表我想在其中记录货币价值。显示时不超过3位,小数点后两位 这就是我编写的sql CREATE TABLE `5050goose` ( `goose_id` int(11) unsigned NOT NULL auto_increment, `name` varchar(100) NOT NULL default '', `width` int(8),

可能重复:

我正在尝试在我的sql db中创建一个表,该表包含几个不同的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 

这清楚地表明小额钱对我不起作用。。因此,我想知道如何在我的sql数据库中存储货币值

事实上你是对的,smallmoney不是mysql中的数据类型。看一看十进制

酷,用十进制(6,2)表示。这显然应该包括-999.99和+999.99之间的任何数字,为链接干杯