Okay so I have the following table design for 'Movie':
movie_id
previous_part
title
Now when I have a Movie id, I want to get all previous and next parts of the movie, but when it's the last movie in a series, the previous_part column will be NULL. I would like a query with a movie_id input that can get all parts of a movie, considering it could be the last movie in a series or just any part in the series.
Edit: It is an SQL query that will be used in MSAcces, but I dont think that matters really. I will try to re-explain it simply: Movie has previous_part, which will be the same as the movie_id of another movie. For example:
Movie 1: movie_id: 1 previous_part: NULL title: "Example movie"
Movie 2: movie_id: 2 previous_part: 1 title "Example movie 2"
Movie 3: movie_id: 3 previous_part: 2 title "Example movie 3"
I want to get all 3 of these movies when you enter either one of the 3 id's. Maybe that clears up the question.
Edit2: I dont think this is a duplicatie question, in my case: when you select the first movie in a series, the previous_part column is NULL, and you want to get the other parts of the movie that come after. How do you do that?