The following query returns a list of all the directors in the database and the movie they made.
Expand|Select|Wrap|Line Numbers
- SELECT Director.Lastname, Director.Firstname, LinkFilmDirector.[Film ID], LinkFilmDirector.[Director ID], Film.Title
- FROM Director INNER JOIN (Film INNER JOIN LinkFilmDirector ON Film.[Film ID] = LinkFilmDirector.[Film ID]) ON Director.[Director ID] = LinkFilmDirector.[Director ID];
The will give a result like:
Lastname Firstname Film ID Director ID Title
Spielberg Steven 1 55 Close Encounters Of The Third Kind
Spielberg Steven 2 55 Color Purple, The
Spielberg Steven 3 55 Amistad
Spielberg Steven 4 55 Catch Me If You Can
What I would like is a query that returns the name of a director just once and next to that name, in a new table, a number that shows the amount of movies.
In layman's terms:
Lastname Firstname Director ID Amount
Spielberg Steven 55 4
I hope I have made myself clear.
Thank you in advance. Margie