postegresql delete 1

postegresql delete

DELETE FROM films
  WHERE producer_id IN (SELECT id FROM producers WHERE name = 'foo');

Here is what the above code is Doing:
1. First, we’re selecting all the films that have a producer_id that matches the id of the producer named ‘foo’.
2. Then, we’re deleting those films.

Similar Posts