how to write a delete query with a join

how to write a delete query with a join

am 15.04.2007 23:22:15 von WindAndWaves

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