Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select movie.title, customer.name FROM
- (select rental.movie_id as movie_id, rental.customer_id as customer_id
- FROM rental
- GROUP BY rental.movie_id, rental.customer_id
- HAVING COUNT(*) > 1) t
- LEFT JOIN customer ON customer.id = t.customer_id
- LEFT JOIN movie ON movie.id = t.movie_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement