How would one go about updating a column in MySQL with column data from an unrelated table?
No common fields so tables cannot be joined.
Column data is all unique and needs to be copied in order.
Have tried:
UPDATE NewTable
SET NewTableID = (SELECT OldTableID
FROM OldTable);
As I understand this would try and update all values in NewTableID to one value from OldTableID - But would fail as it returns more than one value.
I want to take ALL unique OldTableID values in order, and update NewTableID so that it mirrors OldTableID exactly. OldTableID is AUTO_INCREMENT if that changes anything.
Edit 1
The IncidentID of this Incident table is a PK
I wanted to update it into the FK in the Crime Table
IncidentID is AUTO_INCREMENT
Insert causes the data to be added as new rows. I cant insert all data at once as I am importing from CSV