I'm new to MySQL and am trying to do the following:
I have a table 'links' that with a new column called 'project_id", and an existing column called 'project'. I have a second table called 'projects', with a column called 'id'.
I need to use the value of 'links > project' to loop over the corresponding id 'projects > id', and then insert it into 'links > project_id'. Once that is done, we will no longer need 'links > project', as 'links > project_id' will become a foreign key and we can then simply look it up in 'projects'.
My pseudo sql code (I'm brand new to this) looks like:
INSERT INTO links(project_id)
select id
from projects
where project = links(project_id)
Thanks (apologies in advance for being a newb)