I have currently have 2 mysql tables in my db
Film
and Film_Ratings_Report
The primary key for Film is filmid
which is u
Preferred solution for this is to use join
, and don't forget group by
so that you don't have duplicate lines:
select film.*
from film
join film_rating_report on film.filmid = film_rating_report.filmid
and rating = 'GE'
group by film.filmid
EDIT: as correctly noted by @ypercube, I was wrong claiming that the performance of join & group by is better than using subqueries with exists
or in
- quite the opposite.