I work with a publishing database and we keep records of books. Books can have multiple authors. We maintain a table which holds records of the authorship of books. I need a SQL Query to select an author and then also select the other authors who worked with them on each of their books.
The Authorship table looks something like this:
+---------+--------+
| Author | BookID |
+---------+--------+
| 1 | 1 |
| 2 | 1 |
| 1 | 2 |
| 2 | 2 |
| 3 | 2 |
| 4 | 2 |
| 5 | 3 |
| 5 | 4 |
+---------+--------+
So if I selected Author 1 I want to see the authors they worked with. The result would return me authors 2,3, and 4.
The idea here is that I can generate a report for an Author that shows who they have collaborated with in their publishing career.