Skip to content
Advertisement

Update column value where property of foreign key table is equal to property of foreign key table

I am looking to do an update basing myself on the property of another table to which my initial table has a foreign key to, so given the case I have 3 tables:

Is there a way for me to do something like

The reason I cannot use the Id even knowing it is that I am dealing with different environments and the Id does not always match between environments, so I need to use another property that doesn’t change.

https://www.db-fiddle.com/f/sNP8nZc8TsJNHGGqm8STYY/0 here is a fiddle with the example.

Advertisement

Answer

Do you need in this:

https://www.db-fiddle.com/f/sNP8nZc8TsJNHGGqm8STYY/1

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement