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.
精彩评论