mysql - 我应该改变什么才能在 MySQL 中不出现错误 1136?
问题描述
CREATE TABLE IF NOT EXISTS `mushu`.`episode` (
`id_episode` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`number` VARCHAR(5) NOT NULL,
`name` VARCHAR(50) NOT NULL,
`episode_length` VARCHAR(10) NOT NULL,
`location` VARCHAR(150) NOT NULL,
`season_id_season` INT UNSIGNED NOT NULL,
`season_tv_show_id_tv_show` INT UNSIGNED NOT NULL,
PRIMARY KEY (`id_episode`, `season_id_season`, `season_tv_show_id_tv_show`),
INDEX `fk_episode_season1_idx` (`season_id_season` ASC,
`season_tv_show_id_tv_show` ASC) VISIBLE,
CONSTRAINT `fk_episode_season1`
FOREIGN KEY (`season_id_season` , `season_tv_show_id_tv_show`)
REFERENCES `mushu`.`season` (`id_season` , `tv_show_id_tv_show`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
INSERT INTO episode VALUES
(1, '1', 'Pilot', '45 min', 'E:\MuShu', '1', '1'),
(2, '2', 'Another Trip Around the Sun', '45 min', 'E:\MuShu', '1', '1'),
(3, '1', 'Pilot', '43 min', 'E:\MuShu', '1', '2'),
(4, '2', 'A Stray Howl', '43 min', 'E:\MuShu', '1', '2'),
(5, '3', 'Eight Slim Grins', '43 min', 'E:\MuShu', '1', '2'),
(6, '1', 'Burnt Food', '42 min', 'E:\MuShu', '1', '3'),
(7, '2', 'Mount Rushmore', '42 min', 'E:\MuShu', '1', '3'),
(8, '1', 'Impact', '56 min', 'E:\MuShu', '1', '4'),
(9, '1', 'Pilot', '44 min', 'E:\MuShu', '1', '5'),
(10, '2', 'The Lorelais First Day at Chilton', '44 min', 'E:\MuShu', '1', '5'),
(11, '1', 'Pilot', '42 min', 'E:\MuShu', '1', '6'),
(12, '2', 'Independence Day', '42 min', 'E:\MuShu', '1', '6'),
(13, '3', 'Comrades in Arms', '42 min', 'E:\MuShu', '1', '6'),
(14, '1', 'Pilot', '22 min', 'E:\MuShu', '1', '7'),
(15, '2', 'Rockets, Communists and the Dewey Decimal System', '22 min', 'E:\MuShu', '1', '7'),
(16, '1', 'Always and Forever', '45 min', '1', '8'),
(17, '1', 'Pilot', '43 min', '1', '9'),
(18, '2', 'Its All Her Fault', '1', '9'),
(19, '1', 'Pilot', '41 min', '1', '10'),
(20, '2', 'The Jenna Thing', '41 min', '1', '10');
错误代码:1136。列计数与第 16 行的值计数不匹配。
我该如何解决这个错误?
解决方案
一些值为 7 长,其他值为 6。它们都必须相同 (7)。如果您查看第 16 行,就像错误所说的那样,您会看到。
推荐阅读
- bash - 在 bash 中回显输出到文件的问题
- snakemake - 使用snakemake将文件复制到多个目录,其中通配符用于目标名称的一部分
- arrays - 如何拆分奇数数组
- omnet++ - 从 Omnet++ 访问存储在 SUMO 中的旅行时间
- javascript - 如何将道具传递给在 React 中返回组件的导入函数?
- docker-compose - 如何使用 docker compose 在容器的 Azure Web 应用程序上托管多个站点
- android - 用逗号格式化kotlin中的数字
- shell - 在 docker 中执行 nohup 任务的 shell 脚本
- maven - Maven:仅自动将某些库更新到最新版本
- javascript - Firebase - 功能不允许我设置区域