Hey guys, quick question. I have a movie table which records information about certain movies. See below for the table structure.

id Title Length
1 American Pie 160
2 Van Wilder 115
3 Not Another Teen Movie 115
4, Road Trip 130
5 Shawshank Redemption 130
6 Scarey Movie 3 150

How can I get the title of the films that are the same length as another
film? Eg, a query which displays Van Widler and Shawshank Redemption.

I've tried using GROUP BY-HAVING's and such. I just can't seem to work it out.
Any help would be greately appreciated!

9 Years
Discussion Span
Last Post by teddies

You'll need to create a query that joins the table with itself on the Length field.

SELECT movie.Title, movie.Length, movie_1.Title
FROM movie LEFT JOIN movie AS movie_1 ON movie.Length = movie_1.Length;

The first column lists the movie and the third column lists the movies with the same length as the movie in the first column.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.