2012-02-25 20 views
3

を挿入します。私は次のエラーを取得するダービーSQL私はこれは私が実行しようとするステートメントです私のデータベース に値を挿入しようとしている

insert into leverancier (id,naam,straat,nr,postcode,plaats,telefoon) 
    values (1,"stef","bosstraat",88,9240,"Zele",null); 

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. 

問題は何ですか?

+0

私は、文字列を一重引用符で区切る必要があると推測しています。 – Phil

答えて

11

"stef"のように文字列を挿入するには、二重引用符を使用せず、一重引用符('stef')を使用してください。ここに文があるべき方法は次のとおりです。二重引用符は、テーブルやカラム名に使用されているので、

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という名前の列を参照していることを前提としています。

関連する問題