如何修复错误#1054字段中的未知列 [英] how to fix error #1054 unknown column in field

查看:48
本文介绍了如何修复错误#1054字段中的未知列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的桌子.

create table Property(
p_id int(4) null primary key,
p_address varchar(120) not null,
c_id int(4) not null,
foreign key (c_id) references customer (c_id)
);


insert into Property values
('2001','Elm_House_11_Short_Lane_Hertfordshire_H5_667',’3001’);

insert into Property values 
('2002','Jainlight_House_Apple_Lane_Kent_K7_988',’3002’);

insert into Property values
('2003','Excelsior_House_23_Oracle_Centre_Reading',’3003’);

insert into Property values ('2004','27_Wroxton_Road_London_SE15',’3004’);

输入此数据时,我一直收到未知的列错误.

I'm keep getting an unknown column error when entering this data.

推荐答案

在插入int值时删除引号和反引号:

remove the quotes and backticks when you insert int values:

insert into Property values
(2001,'Elm_House_11_Short_Lane_Hertfordshire_H5_667',3001);

insert into Property values 
(2002,'Jainlight_House_Apple_Lane_Kent_K7_988',3002);

insert into Property values
(2003,'Excelsior_House_23_Oracle_Centre_Reading',3003);

insert into Property values (2004,'27_Wroxton_Road_London_SE15',3004);

仅当使用char字段时需要用引号,而反引号是表名或列名的转义字符.

Quotes are only needed, when you working with char fields and backticks are escape characters for table or column names.

这篇关于如何修复错误#1054字段中的未知列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆