Using the from clause with update  Updating IDENTITY columns

Chapter 7: Adding, Changing, and Deleting Data

Performing updates with joins

The following example joins columns from the titles and publishers tables, doubling the price of all books published in California:

update titles 
  set price = price * 2 
  from titles, publishers 
  where titles.pub_id = publishers.pub_id 
  and publishers.state = "CA"




Copyright © 2005. Sybase Inc. All rights reserved. Updating IDENTITY columns

View this book as PDF