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

List:       mysql-win32
Subject:    INNER JOIN with MySQL and more than one table [translation]
From:       "David Vergin" <dvergin () igc ! org>
Date:       2001-10-29 19:38:53
[Download RAW message or body]

A quick unsolicited translation on behalf of: Gonzalo Valenzuela
[mailto:gvalenz@vianet.cl]

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

> -----Original Message-----
> From: Gonzalo Valenzuela [mailto:gvalenz@vianet.cl]
> Sent: Monday, October 29, 2001 9:09 AM
> To: win32@lists.mysql.com
> Cc: jacevedo@vianet.cl
> Subject: INNER JOIN con MySQL y más de una tabla
>
>
> Hola a todos, quisiera saber si se puede hacer un update en MySQL que pueda
> referenciar más de una tabla, como por ejemplo con un INNER JOIN. Tengo dos
> posibles soluciones pero no funcionan con 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;
>
> En los dos casos no funcionan con MySQL.
>
> Gracias.
>
> 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-thread7629@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