Alex B provides a good answer but it didn't work for me. too much work right now.
Unfortunately I had to do the delete in two statements, but it worked out just fine. I have two tables, movies and movie_providers, movie_providers is a join table that tells which provider is showing my movie.
I wanted:
DELETE FROM movies, movie_pproviders WHERE movie.id = movie_providers.movie_id AND [my constraint]
but had to do 2 steps
DELETE FROM movies WHERE [my constraint]
DELETE FROM movie_providers where movie_id NOT IN (select distinct id from movies)
This assumes i had consistency between movies and movie_providers before. If not, I just created consistency.
Worked fine... hope it helps someone.
Rajat Banerjee