2011-01-26 9 views

risposta

15

Potreste usare not exists:

delete from user 
where not exists (select * from message m where m.userid = user.id) 
     and not exists (select * from archivedMessage am where am.userid = user.id) 
+0

ci sono pro/contro contro la 'LEFT JOIN ... è il metodo NULL'? – Toto

+1

@Toto: Funzionalmente sono uguali, ma potrebbero esserci differenze di prestazioni – Andomar

Problemi correlati