Sorry Jay,

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!

Thanks for your help,

Shaun

From: "Jay Blanchard" <[EMAIL PROTECTED]>
To: "shaun thornburgh" <[EMAIL PROTECTED]>, <mysql@lists.mysql.com>
Subject: RE: Help with an UPDATE query please
Date: Wed, 29 Dec 2004 13:53:07 -0600


[snip]
I am having trouble with an UPDATE query. I have three tables as defined

below. My database holds data for bookings. Each booking relates to a
project. Each project has many tasks, one of which is a booking. I have
now
added the column Task_ID to the bookings table. How can I update all the

bookings so that the Task_ID is the same as the Task_ID in the Tasks
table
for that project and the task is a booking?
[/snip]

Can you show us some test data and an example of what you want to
happen? Also, what version of MySQL are you running?



-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to