Are there overlapping names? If so, also assure that the teams correspond (add s.HomeTeam = p.team
to the where block). If there are players with the same name in one team, you will have to solve these conflicts manually.
To select all the keepers/captains at once, you need left outer joins. I guess it will be one join per player, so you have to join the same table 4 times.
Once you've selected the right data, you can insert it in your testMatch
table with INSERT ... SELECT.
Larry_Croft
2010-02-27 18:51:43