Page 1 of 1

sql to copy from one table to another

Posted: Mon Aug 23, 2004 8:16 pm
by neophyte
I'm trying to get two columns from one table (articles) to copy into two columns of a second table (article_assignment). I keep getting a mysql error indicating a syntax error near VALUES.

Does anybody know where I've gone astray?

Code: Select all

INSERT INTO article_assignment(article_id, category_id) SELECT article_id, article_category FROM articles VALUES (articles.article_id, articles.article_category)

COOKED THE GOOSE

Posted: Mon Aug 23, 2004 8:41 pm
by neophyte

Code: Select all

INSERT INTO article_assignment(article_assignment.article_id, article_assignment.category_id) SELECT articles.article_id, articles.article_category FROM articles WHERE articles.article_id>14
n00b says, "You don't need to insert Values" :oops: