This is for my studies, so I would prefer if you guys could give hints opposed to answers, I don't mind either though. :)
The following link is my data in a SQLFiddle: http://sqlfiddle.com/#!2/d7373
CREATE TABLE Movies
(`MovieID` int, `Title` varchar(6), `YearReleased` int)
;
INSERT INTO Movies
(`MovieID`, `Title`, `YearReleased`)
VALUES
(1002, 'movie1', 2001),
(1003, 'movie2', 1951),
(1004, 'movie3', 2001),
(1005, 'movie4', 2004),
(1006, 'movie2', 2007),
(1007, 'movie5', 2005),
(1008, 'movie2', 2010),
(1009, 'movie3', 2006),
(1010, 'movie6', 2003),
(1011, 'movie7', 2002),
(1012, 'movie8', 2004),
(1013, 'movie9', 2002)
;
What I want to do is to output the Name and Years Released of movies that have been released more than once. So if you look in the SQL Fiddle 'movie3' has been released twice, so i would like to output it's name and both years it was released. If a movie has been released 3 times it need to be displayed three times because there are 3 pairs release dates. The following is an example of how I would like the data in the SQL Fiddle to be outputted.
Movie | FirstRelease | SecondReleased
---------------------------------------
movie2 | 1951 | 2007
movie2 | 1951 | 2010
movie2 | 2007 | 2010
movie3 | 2001 | 2007
Thanks Guys.