Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. select movie.title, customer.name FROM
  2. (select rental.movie_id as movie_id, rental.customer_id as customer_id
  3. FROM rental
  4. GROUP BY rental.movie_id, rental.customer_id
  5. HAVING COUNT(*) > 1) t
  6. LEFT JOIN customer ON customer.id = t.customer_id
  7. LEFT JOIN movie ON movie.id = t.movie_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement