Rich Rattanni wrote:

I mean't when I tried this...
update Parameters set value = (select value from WorkingParameters wp);
When you execute this, it works, but it takes the first result row
from value and copies it into all the rows of parameters.

Rich,

When you execute an update statement, the set clause is executed for each row in the table in turn.

for each row in table parameters
   set value = <value of expression>

Your expression is a sub-select statement which returns the value of the first row in the workingparameters table as discussed in the documentation. So you end up with this:

for each row in table parameters
   set value = <value of first row of working parameters>

By adding a where clause to the sub-select statement, Igor was selecting the value from the single (or first if there are multiple) row that has the same id as the row in the parameters table you are updating. This sub-select statement returns a different value for each row in the parameters table.

for each row in table parameters
set value = <value of the row in working parameters with an id the same as the current row of parameters>

HTH
Dennis Cote



-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to