Re: UPDATE with INNER JOIN?

From: Date: Thu, 13 Dec 2007 03:31:11 +0000
Subject: Re: UPDATE with INNER JOIN?
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-44406@lists.php.net to get a copy of this message
Ron Piggott wrote:
Is it possible to do an UPDATE with an INNER JOIN --- I want the WHERE to use 2 tables in selecting which rows are going to be updated in table1.
http://dev.mysql.com/doc/refman/5.0/en/update.html You can also perform UPDATE operations covering multiple tables. However, you cannot use ORDER BY or LIMIT with a multiple-table UPDATE. The table_references clause lists the tables involved in the join. Its syntax is described in Section 11.2.7.1, “JOIN Syntax”. Here is an example: UPDATE items,month SET items.price=month.price WHERE items.id=month.id; -- Postgresql & php tutorials http://www.designmagick.com/

« previous php.db (#44406) next »