创建触发器成功以后,再向food2表中插入数据
insert语句为:
【mysql> insert into food2 values(null,"统一鲜橙多","统一集团即统一业","5.5",2014,3,"台南市永康区中正路301号");】
ERROR 1136 (21S01): Column count doesn't match value count at row 1
mysql> insert into food2
(id,name,company,price,produce_time,validity_time,produce_address)
values(1,"统一100","统一集团即统一业","5.5",2014,3,"台南市永康区中正路301号");
ERROR 1136 (21S01): Column count doesn't match value count at row 1
指定了字段还是显示这个匹配错误的问题,很是费解到底哪里错了呢~
food2的表属性字段
mysql> show create table food2\G
*************************** 1. row ***************************
Table: food2
Create Table: CREATE TABLE `food2` (
`id` int(4) NOT NULL auto_increment,
`name` varchar(20) NOT NULL,
`company` varchar(40) NOT NULL,
`price` float NOT NULL,
`produce_time` year(4) NOT NULL,
`validity_time` int(4) NOT NULL,
`produce_address` varchar(40) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)作者: guji0327 时间: 2014-2-4 21:35
mysql> insert into food2
(id,name,company,price,produce_time,validity_time,produce_address)
values(1,"统一100","统一集团即统一业","5.5",2014,3,"台南市永康区中正路301号");
ERROR 1136 (21S01): Column count doesn't match value count at row 1
指定了字段还是显示这个匹配错误的问题,很是费解到底哪里错了呢~
food2的表属性字段
mysql> show create table food2\G
*************************** 1. row ***************************
Table: food2
Create Table: CREATE TABLE `food2` (
`id` int(4) NOT NULL auto_increment,
`name` varchar(20) NOT NULL,
`company` varchar(40) NOT NULL,
`price` float NOT NULL,
`produce_time` year(4) NOT NULL,
`validity_time` int(4) NOT NULL,
`produce_address` varchar(40) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)作者: fwbook 时间: 2014-2-5 15:27