MySQL: Finding rows that don’t take part in a relationship
Here’s a typical way to do this query without using the subquery method you showed. This may satisfy @Godeke’s request to see a join-based solution. SELECT * FROM movies m LEFT OUTER JOIN seen s ON (m.id = s.movie_id AND s.user_id = 123) WHERE s.movie_id IS NULL; However, in most brands of database this solution … Read more