正如标题所说,我创建了一个表,其中一列是 varchar(50) 类型,但是它拒绝第一个值为字符串的 INSERT 语句:
表创建:
CREATE TABLE Fiddy(Lname varchar(50),
-> Height int,
-> Width int,
-> Gas int);
插入尝试
insert into Fiddy VALUES(Smith, 54, 43, 1);
ERROR 1054 (42S22): Unknown column 'Smith' in 'field list'
插入尝试
insert into Fiddy values (4, 5, 5, 6);
Query OK, 1 row affected (0.00 sec)
选择 *
select * from Fiddy;
+-------+--------+-------+------+
| Lname | Height | Width | Gas |
+-------+--------+-------+------+
| 4 | 5 | 5 | 6 |
+-------+--------+-------+------+
1 row in set (0.00 sec)