I have been trying different sql queries that do the following:
For all the table entries which have a field that has a field_value in clumn_a of table_1 which equals any field value in column_b of table_2 insert the id of the field in table_2 in id_of_the_other_entry_column of table_1.
However I can only use SQL and not use anything else than a SQL command for that. Is this even possible without the help of another programming language? If so.. any tips?
EDIT: An example:
TableOwner
id name
1 SomeCompany
2 SomeOtherCompany
TableContracts
Name ownerid
NewCompany Null --> Should remain null after the query
SomeCompany Null -->Should change to 1 after the query
SomeCompany Null -->Should change to 1 after the query
SomeOtherCompany Null -->Should change to 2 after the query
thanks