列的列说明符不正确 [英] incorrect column specifier for column

查看:185
本文介绍了列的列说明符不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有:

create table `products`
(
    `id` int(11) not null auto_increment,
    `price` float(255),
    `weight` int(11),
    `sku` varchar(255),
    `stock_level` int(11),
    `image` mediumblob(1000),
    `search_engine_name` varchar(255),
    `description` varchar(1000),
    `url` varchar(255),
    `category` varchar(255),
    primary key (`id`)
);

MySql输出:列'price'的列说明符不正确

MySql outputs: "Incorrect column specifier for column 'price'

这是为什么?

推荐答案

float(255)无效.

您可以省略括号中的值,例如只需单独使用float或使用类似于float(7,4)的括号在括号中指定值(请参见

You can omit the value in the brackets, e.g. just have float by itself or specify the value in the brackets using something like float(7,4) (see this for information on what the values mean...you may need to customise these depending on what you're intending to store in the column)

这篇关于列的列说明符不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆