The FROM Clause

Use the FROM clause to pull data from one or more tables into the table you're updating. When author Dirk Stringer gets a contract, a title identification number is assigned to his book, The Psychology of Computer Cooking, in the titles table. You can modify his row in the titleauthor table by adding a title identification number for him:

UPDATE titleauthor
SET title_id = titles.title_id
FROM titles, authors, titleauthor
WHERE titles.title = 'Net Etiquette'
AND au_lname = 'Locksley'
AND authors.au_id = titleauthor.au_id
AND titles.title_id = titleauthor.title_id

Note that an UPDATE without the au_id join changes all the title_ids in the titleauthor table to the same identification number as the one for The Psychology of Computer Cooking.