Brendan Gogarty wrote:

> We are running mysql 3.23.58 and I want to do a query with joins
> from two tables and then insert the results into the column of a third.
<snip>

Shawn Green wrote:

Start from here: http://dev.mysql.com/doc/mysql/en/update.html
Updates *are* allowed to use JOINED tables as the "thing to be updated".
Which means that an UPDATE statement can look VERY MUCH like a SELECT
statement turned on it's head. In your case, I think you are trying to
figure out how to flip this:
<snip>

Brendan Gogarty wrote:
Hi Shaun,
I'm afraid after a few hours of testing various things it doesn't work. I am pretty sure its a version issue as even the simplest query such as UPDATE links_DB
LEFT JOIN
page_elements
SET links_DB.in_group=0
brings up an error

MySQL said: You have an error in your SQL syntax near 'LEFT JOIN page_elements SET
links_DB.in_group = 0' at line 1

cheers,
brendan.

From the manual page Shawn cites: "Starting with MySQL 4.0.4, you can also perform UPDATE operations that cover multiple tables." So, yes, it's a version issue.

Michael

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

Reply via email to