开发者

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

开发者 https://www.devze.com 2023-01-07 11:54 出处:网络
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 iget rid of the synatx error Are you thinking this?
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

精彩评论

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