i want to copy data form one talble to another in mysql
Posted: Sat Jan 09, 2010 2:56 am
i want to copy data form one talble to another in mysql using join
what i want to do is copy data from temp table select id and correspoding name and add it to another table (data) by checking perticular id and insert name in the info column of (data) table
i have written query in mysql but it gives error the query is
UPDATE questions
SET questions.answer = temp.name
FROM questions INNER JOIN temp
ON questions.ID = temp.tempID
but it cant work it gives error as
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM questions INNER JOIN temp ON questions.ID = temp.tempID' at line 3
what should i do??
what i want to do is copy data from temp table select id and correspoding name and add it to another table (data) by checking perticular id and insert name in the info column of (data) table
i have written query in mysql but it gives error the query is
UPDATE questions
SET questions.answer = temp.name
FROM questions INNER JOIN temp
ON questions.ID = temp.tempID
but it cant work it gives error as
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM questions INNER JOIN temp ON questions.ID = temp.tempID' at line 3
what should i do??