I have to update two columns in separate tables, but I do not know the commands very well, I would not like to use triggers.
Will be updated around 100 records.
Here is an example:
Table a
id nomes nota
1 SOen etc1
2 SOpt etc2
Table b
id nomes outros
1 SOen i
2 SOen rre
3 SOpt le
4 SOen van
5 SOpt te
That is, when I update a row of the a
table, all rows with the same name as the a
table in the b
should also be updated, leaving the same name changed in the a
table.
Example of effect of desired update:
Update a SET nomes = SOpt_BETAP WHERE nomes = SOpt
Table a
| Updated table with new names
id nomes nota
1 SOen etc1
2 SOpt_BETA etc2
Table b
| Table b is also updated with new names
id nomes outros
1 SOen i
2 SOen rre
3 SOpt_BETA le
4 SOen van
5 SOpt_BETA te
It would be beneficial to me and to other users if I could make a brief explanation of each parameter used as ON
, JOIN
etc, explaining the function of it there, for those who also have doubts.