select pi.PlayerID as PlayerID, concat_ws(' ',FirstName,LastName) as Name, TeamID, DraftYear, min(YearPlayed) as Start, max(YearPlayed) as End from PlayerInfo pi left join Players p using(PlayerID) left join Draft d using(PlayerID) group by PlayerID, Name, TeamID order by PlayerID, Start, End;The result will look something like this:
+----------+---------------------+--------+-----------+-------+------+As you can see at the beginning, there is a problem with this. The first year in the PlayerInfo table (which is a table of information that changes year to year, stint to stint), does not equal the year for which the player was drafted. That's because I started the database in 1995, then overwrote a lot of data in 1996 before realizing I needed yearly data preserved in a separate table (the birth of the PlayerInfo table separate from Players).
| PlayerID | Name | TeamID | DraftYear | Start | End |
+----------+---------------------+--------+-----------+-------+------+
| 1 | Darrin Jackson | SEI | 1995 | 1996 | 1996 |
| 2 | Makoto Sasaki | SEI | 1984 | 1996 | 1998 |
| 2 | Makoto Sasaki | HAN | 1984 | 1999 | 2000 |
| 3 | Ken Suzuki | SEI | 1988 | 1996 | 2002 |
| 3 | Ken Suzuki | YAK | 1988 | 2003 | 2007 |
| 4 | Tsutomu Itoh | SEI | 1982 | 1996 | 2007 |
| 5 | Kazuhiro Kiyohara | SEI | 1986 | 1996 | 1996 |
| 5 | Kazuhiro Kiyohara | YOM | 1986 | 1997 | 2005 |
| 5 | Kazuhiro Kiyohara | ORX | 1986 | 2006 | 2008 |
| ... | ... | ... | ... | ... | ... |
| 1000 | Bill Selby | YOK | 1997 | 1997 | 1997 |
| 1001 | Takahiro Ohno | YOK | 1997 | 1997 | 2001 |
| 1002 | Yoshihito Ishii | YOK | 1997 | 1997 | 2002 |
| 1002 | Yoshihito Ishii | SEI | 1997 | 2003 | 2008 |
| 1003 | Yoshio Yoshida | HAN | 1953 | 1997 | 1998 |
| 1004 | Tadahiro Hoshiyama | HAN | 1997 | 1997 | 2000 |
| ... | ... | ... | ... | ... | ... |
| 2000 | Kei Hosoya | LOT | 2006 | 2006 | 2008 |
| 2001 | Daniel Carrasco | SFT | 2006 | 2006 | 2006 |
| 2002 | Yoshiaki Fujioka | SFT | 2006 | 2006 | 2008 |
| 2003 | Keisuke Kattoh | SFT | 2006 | 2006 | 2008 |
| 2004 | Akihiro Yanase | SFT | 2006 | 2006 | 2008 |
| ... | ... | ... | ... | ... | ... |
+----------+---------------------+--------+-----------+-------+------+
This is a site about Pro Yakyu (Japanese Baseball), not about who the next player to go over to MLB is. It's a community of Pro Yakyu fans who have come together to share their knowledge and opinions with the world. It's a place to follow teams and individuals playing baseball in Japan (and Asia), and to learn about Japanese (and Asian) culture through baseball.
It is my sincere hope that once you learn a bit about what we're about here that you will join the community of contributors.
Michael Westbay
(aka westbaystars)
Founder