mysql create table with decimal not null

时间:2015-05-14 22:54:59

标签: mysql

这会在十进制数(3,2)非空,行

时爆炸
CREATE TABLE IF NOT EXISTS nutrition (
    foodID INT NOT NULL,
    measurmentID NOT NULL,
    amount DECIMAL(3,2) NOT NULL,
    calories INT NOT NULL,
    carbs DECIMAL(3,2) NOT NULL,
    fat DECIMAL(3,2) NOT NULL,
    protein DECIMAL(3,2) NOT NULL,
    sodium DECIMAL(3,2) NOT NULL,
    fiber DECIMAL(3,2) NOT NULL,
);

1 个答案:

答案 0 :(得分:1)

measurementID NOT NULL没有类型定义。