Enterprise Edition Home | Express Edition Home | Previous Page | Next Page   SQL Statements > UPDATE >

Updating the Same Column Twice

You can specify the same column more than once in the SET clause. If you do so, the column is set to the last value that you specified for the column. In the next example, the fname column appears twice in the SET clause. For the row where the customer number is 101, the user sets fname first to gary and then to harry. After the UPDATE statement executes, the value of fname is harry.

UPDATE customer
   SET fname = "gary", fname = "harry"
      WHERE customer_num = 101
Enterprise Edition Home | Express Edition Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]