2
I have a sales chart that contains the seller’s code.
However the seller’s table was all redone, with the change of id
.
How can I update the seller code in the sales table from the comparison between the new seller table and the old?
I tried to make join
but it was done update
with the same id
from seller to all table records vendas
.
How to update with a Join?
– rray
The first thing you have to do is define how to know that two records, one from the old table and the other from the new table, refer to the same seller. Having defined this match is only update the sales table, for example with the result of joining the new and old seller tables. From what you describe the result most likely your WHERE clause is wrong.
– anonimo
Assuming that the seller table id is the primary key of this table and that such a field was used as a foreign key in the sales table, how do you think you can associate the old id with the new id? What are the definitions of your tables and particularly the definition of foreign keys.
– anonimo
What is it possible to compare in the tables to define the association between the old id and the new one generated when you remade the seller table? I hope you have a backup of your bank in the position prior to the action of redoing the table.
– anonimo