update a table with joins