首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >derby sql插入

derby sql插入
EN

Stack Overflow用户
提问于 2012-02-25 19:31:53
回答 1查看 9.1K关注 0票数 4

我尝试在数据库中插入值,这是我尝试执行的语句:

代码语言:javascript
复制
insert into leverancier (id,naam,straat,nr,postcode,plaats,telefoon) 
    values (1,"stef","bosstraat",88,9240,"Zele",null);

我得到以下错误:

代码语言:javascript
复制
ERROR 42X04: Column 'stef' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'stef' is not a column in the target table.

有什么问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-02-25 19:41:24

要插入字符串,比如"stef",不要使用双引号,而要使用单引号:'stef'。下面是语句应该是什么样子的:

代码语言:javascript
复制
INSERT INTO leverancier 
  (id, naam, straat, nr, postcode, plaats, telefoon) 
VALUES 
  (1,'stef', 'bosstraat', 88, 9240, 'Zele', NULL);

出现Column 'stef' is either not in any table ...的错误是因为表名和列名使用了双引号。因此,在读取"stef"时,解析器假定您引用的是一个名为stef的列。

票数 13
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9443599

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档