Hi,
I am a newbie on the MySQL front hopefully you guy's can help:
OK I have a table that collates soccer team player bookings, in my table I have the follow columns:
ID <---- Unique ID
TEAMID <---- Team Name
HOMETEAM <---- Name of Home Team
AWAYTEAM <---- NAme of Away Team
HOMEYELLOW1 <---- Name of 1st HOME player booked in match
HOMEYELLOW2 <---- Name of 2nd HOME player booked in match
HOMEYELLOW3 <---- Name of 3rd HOME player booked in match
etc etc
HOMERED1 <---- Name of 1st AWAY player sent off in match
HOMERED2 <---- Name of 2nd AWAY player sent off in match
etc etc
AWAYYELLOW1 <---- Name of 1st AWAY player booked in match
AWAYYELLOW2 <---- Name of 2nd AWAY player booked in match
AWAYYELLOW3 <---- Name of 3rd AWAY player booked in match
etc etc
AWAYRED1 <---- Name of 1st AWAY player sent off in match
AWAYRED2 <---- Name of 2nd AWAY player sent off in match
Basically and I am unsure if this is possible at all, say for example player name 'SMITH' was booked in numerous games: i.e:
SMITH booked in match #1 (HOMEYELLOW3)
SMITH booked in match #4 (AWAYYELLOW2)
SMITH booked in match #15 (HOMEYELLOW1)
SMITH sent off in match #26 (AWAYRED2)
I am looking for a query that will search across all the HOMEYELLOW, HOMERED, AWAYYELLOW, AWAYRED columns for the string 'SMITH' and then COUNT them up,giving me a total.
I am unsure if I can do this across multiple columns etc?
Apologies if I have not made sense lol and thanks in advance for any help/assistance provides.
Thanks,
C.