how to write a delete query with a join

Hi Folk

How can I rewrite the following:

SELECT `USR`.`ID`
FROM `USR`
LEFT JOIN `USR_STORE`
ON `USR_STORE`.`ID` = `USR`.`ID`
WHERE `USR_STORE`.`ID` = NULL ;

into a delete from USR query. I tried

DELETE
FROM `USR`
LEFT JOIN `USR_STORE`
ON `USR_STORE`.`ID` = `USR`.`ID`
WHERE `USR_STORE`.`ID` = NULL ;

but it does not seem to work...

In the select statement I get 200,000 rows... so there is definitely
some deleting to do...

Thank you

Nicolaas
WindAndWaves [ So, 15 April 2007 23:22 ] [ ID #1688165 ]
Datenbanken » mailing.database.mysql » how to write a delete query with a join

Vorheriges Thema: backing up mysql
Nächstes Thema: Replication - binary log auto removal after processing