phpbar.de logo

Mailinglisten-Archive

update left join

update left join

Ralf Narozny mysql-de_(at)_lists.bttr.org
Mon, 22 Jul 2002 15:39:13 +0200


Moin moin!

Patrick Bierans wrote:

>update bilder 
>set used=0 where id in 
>  select b.id from bilder as b left join artikel as a 
>  on b.name=a.bildname
>  where a.id is null;
>
>How do I in MySql without temp. tables?
>  
>

In Linux shell I'd do:

echo "SELECT concat('UPDATE bilder SET used = 0 WHERE id = ', id, ';') 
FROM bilder AS b LEFT JOIN artikel AS a ON (b.name = a.bildname) WHERE 
a.id IS NULL" | mysql -N -u <user> -p <dbname> | mysql -N -u <user> -p 
<dbname>

but without further details....

Gruß
 Ralf

-- 
Ralf Narozny
SPLENDID Internet GmbH & Co KG
Skandinaviendamm 212, 24109 Kiel, Germany
fon: +49 431 660 97 0, fax: +49 431 660 97 20
mailto:rnarozny_(at)_splendid.de, http://www.splendid.de



---
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive