I have a table playerStat : playerName and statistics
table player: playerName and team
table game: teamA and teamB
I want to select all players statistics of a selected game, where each game has 2 teams, so I want to select the players of each team and retrieve their statistics.
it would look something like this:
Select * from playerStat ps left join player pl on ps.playername=pl.playeeName left join game g on g.teamA or g.teamB = pl.team
please correct my scenario up there to retrieve what I want.thank you in advance
try this
Select * from playerStat ps right join player pl on ps.playername=pl.playeeName inner join game g on g.teamA = pl.team OR g.teamB = pl.team where g.gameid=@gameid
cnuonline
try this
Select * from playerStat ps right join player pl on ps.playername=pl.playeeName inner join game g on g.teamA = pl.team OR g.teamB = pl.team where g.gameid=@gameid
how do I declare the above statement in a variable to return it to test it?
lolo512
how do I declare the above statement in a variable to return it to test it?
Did not get what the question is. explain it clearly