开发者

Why does this MySQL query give "error 1136" when inserting values into table [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

Query:

INSERT INTO Customer2
VALUES (1, 'Mrs','Ji开发者_开发技巧ll','Hill','2 Step St','Hillington','Uxbridge',
        'Middx''UB10 8XY','020    8999 684') ;


From the little details you gave, this is how that query should look like:

INSERT INTO Customer2 VALUES (1, 'Mrs','Jill','Hill','2 Step St','Hillington','Uxbridge','Middx','UB10 8XY','020 8999 684') ;

You're missing a comma between Middx and UB10


You are missing a comma between

'Middx''UB10 8XY'
       ^

When MySql finds two strings separated by nothing or whitespace it concatenates them.
This decreases the number of values in your values list by 1 resulting in 1136 error.

You can see a demo here.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜