I currently have two tables, and one has a dependency on the other that I want to remove.
Let’s say the tables are Product and Employee, and there are about 800,000 rows in each table.
The Employee table has a ProductID, in which there is a ProductRefID, which I need to reference in my application. The way this is done is to join in the Product table, and reference the ProductRefID that way.
However, I now want to change this so that ProductRefID is a column on the Employee table, and then transfer every Product row’s “ProductRefID” to the Employee row’s “ProductRefID”.
What would be the most efficient way of writing this query?
(I know it sounds stupid, but it’s just an example, it’s not actually what I’m trying to do specifically).
Something like this ?