[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-win32
Subject:    INNER JOIN with UPDATE
From:       Gonzalo Valenzuela <gvalenz () vianet ! cl>
Date:       2001-10-30 17:39:14
[Download RAW message or body]

Hello everyone,

I want to know if it is possible to do an update in MySQL that references more
than one table; for example with and INNER JOIN. I have two possible solutions
but they do not work with MySQL.

UPDATE nivel3 INNER JOIN nivel2
ON nivel3.pert = nivel2.cod
AND nivel2.x = 1
SET nivel3.x = 1;

UPDATE nivel3
SET nivel3.x = 1
FROM (nivel3 INNER JOIN nivel2 ON nivel2.cod = nivel3.pert)
WHERE nivel2.x = 1;

Neither case works with MySQL.

Thanks.

Gonzalo Valenzuela S.
Teléfono: 562 2451248
Móvil: 09 4892052
http://www.vianet.cl


---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail win32-thread7632@lists.mysql.com

To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail win32-unsubscribe@lists.mysql.com instead.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic