Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Updating rows to current values

Updating rows to current values

From: Ken Denny <kdenny_at_interpath.com>
Date: 1997/06/04
Message-ID: <3395A391.7CC5@interpath.com>#1/1

I was writing a package and in it I wanted to update several rows in the database. Let's say the table is called tab1 and I want to update a column called status. I had:

   UPDATE tab1 SET status = 'A' WHERE <condition>; In this case there may be thousands of rows which satisfy the condition, and it is possible that a large portion of them may already have 'A' in the status column. I figured that it may perform better if I only update those rows which need it so I changed the statement to:

   UPDATE tab1 SET status = 'A' WHERE <condition> AND status != 'A'; My question is, was this necessary, or would it have performed equally well with or without the "AND status != 'A'" clause?

Thanks in advance
Ken Denny
kdenny_at_interpath.com Received on Wed Jun 04 1997 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US