List:General Discussion« Previous MessageNext Message »
From:Jay Blanchard Date:December 29 2004 8:16pm
Subject:RE: Help with an UPDATE query please
View as plain text  
[snip]
I am using version 3.23.54, unfortunately I am unable to supply test
data 
but basically I need to update the Task_ID column for the Bookings table
so 
that it is the same as the Task_ID for Tasks and the Task_Name is
'Booking' 
and the Bookings Project_ID is the same as the Tasks Project_ID.

This is what I need to do:

UPDATE Bookings B
SET B.Task_ID = T.Task_ID
WHERE T.Task_Name = 'Booking'
AND B.Project_ID = T.Project_ID

However I dont know how to introduce the Tasks T alias into the query!
[/snip]

Fortunately we have been having a discussion about multi-table updates
for the past couple of days. Unfortunately your version of MySQL does
not support multi-table updates (http://www.mysql.com/update - "Starting
with MySQL 4.0.4, you can also perform UPDATE operations that cover
multiple tables:")




"It causes you to go to the end so that you can read from the
beginning."
"Why?"
"Top posting is bad"
Thread
Help with an UPDATE query pleaseshaun thornburgh29 Dec
RE: Help with an UPDATE query pleaseJay Blanchard29 Dec
  • RE: Help with an UPDATE query pleaseshaun thornburgh29 Dec
RE: Help with an UPDATE query pleaseJay Blanchard29 Dec