You are exactly right. I didn't know the subselect statement could
reference the table in the update clause, and that was my main
question.
The only real difference then is the size of the statement if you
wanted to update 5 fields you would need to repeat the subselect 5
times.

Sim
________________________________________________________________________________

Sim Zacks wrote:

> Elke,
> 
> A simple example of the power of including joins in an Update
> Statement:
> 
> Update Tbl1 set tbl1.field1=tbl2.field2*.10,
> from Tbl1 join tbl2 on tbl1.PKfield=tbl2.tbl1FK
> 
I'm nearly sure you meant something like
... on tbl1.tbl1FK=tbl2.PKfield ?

and then

update tbl1 set field1=(select field2*.10 from tbl2 where tbl1.fkfield=tbl2.pkfield)

works fine


-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to