开发者

syntax error 'select a,b,c,d,e,f from'

INSERT INTO abc
VALUES (

a, b, c, d, e, f
)
SELECT a, b, c,开发者_开发百科 d, e,f
FROM bcd

when i execute this iam getting synatx errors .how do i get rid of the synatx error


Are you thinking this?

INSERT INTO abc(a,b,c,d,e,f) SELECT a,b,c,d,e,f from bcd;


the problem is you don't use the VALUES keyword when using a select statement to populate the values.

INSERT INTO abc (a,b,c,d,e,f) SELECT a, b, c, d, e,f FROM bcd

Here is a reference for the INSERT syntax


Here a,b,c,d,e,f are values or field names?

if they are values,

It will be: INSERT INTO abc VALUES('a','b','c','d','e','f');

If they are fields, you have to specify values to insert.

SELECT is ok, if they are fields.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜