我在'字段列表'
中收到错误代码1054未知列'interlake'drop table if exists `Boats`;
create table `Boats` (
`bid` int(11) not null,
`bname` varchar(45) default null,
`color` varchar(15) default null,
primary key (`bid`)
) engine=InnoDB default charset=latin1;
alter table `Boats` disable keys;
insert into `Boats` values
(101,`Interlake`,`blue`),(102,`Interlake`,`red`),(103,`Clipper`,`green`),(104,`Marine`,`red`);
alter table `Boats` enable keys;
答案 0 :(得分:2)
使用引号而不是后退标记
INSERT INTO `Boats`
(`bid`, `bname`, `color`)
VALUES
(101,"Interlake","blue"),
(102,"Interlake","red"),
(103,"Clipper","green"),
(104,"Marine","red");
答案 1 :(得分:0)
您是否尝试删除后退并使用撇号?
insert into `Boats` values
(101, 'Interlake', 'blue'),(102, 'Interlake', 'red'),(103, 'Clipper', 'green'),(104, 'Marine', 'red');
答案 2 :(得分:0)
您缺少“值”并使用引号(''或“”)而不是后退标记(``)。
试试这个
drop table if exists `Boats`;
create table `Boats` (
`bid` int(11) not null,
`bname` varchar(45) default null,
`color` varchar(15) default null,
primary key (`bid`)
) engine=InnoDB default charset=latin1;
ALTER TABLE `Boats` disable KEYS ;
INSERT INTO Boats
( bid, bname, color)
VALUES
( 101, 'Interlake', 'blue'),
( 102, 'Interlake', 'blue'),
( 103, 'Interlake', 'blue');
ALTER TABLE `Boats` enable KEYS ;