I am trying to append some database information from an old database to a new one. Below is the code i am using however i get the following error and don’t know why.
UPDATE specs s, cross_ref c
SET s.cross_ref = CONCAT_WS(',', 's.cross_ref', 'c.comp_num)
WHERE s.part_num = c.part_num
Error:
"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 ''c.comp_num)
WHERE s.part_num = c.part_num' at line 1"
Your single quotes are in the wrong place – you don’t need to wrap the column names.