I am trying to get all the co-authors of an author. The first column is the id of a publication. The next three columns are the first, middle and last names of an author.
4 KARL K KWON
4 JACK A SMITH
4 DINESH SMITH
5 KARL K KWON
5 JACK B SMITH
6 AMEY SCHENCK BAILEY
6 KARL K KWON
6 DINESH SMITH
6 JACK SMITH
13 JACK SMITH
13 RONALD VALE
I would like to get the following output
JACK A SMITH {DINESH SMITH, KARL K KWON}
JACK B SMITH {KARL K KWON}
JACK SMITH {AMEY SCHENCK, KARL K KWON, DINESH SMITH, RONALD VALE}
I am unable to understand which structure to use to store this new data and how to obtain it. Any suggestions/ideas...
Edit
This is not a simple group by publication id. For example, JACK SMITH has 2 publications here with ids 6 and 13. So the coauthors of both these publications need to be found and added to our set of co-authors for JACK SMITH.