Mrbaseball34
Programmer
I have this query...
select distinct games.*, teams.teamname as teamname
from games, teams
where
(((games.homeid=teams.id) or (games.visitorid=teams.id))
and (teams.division="A"
and ((games.homescore is not null) and (games.visitorscore is not null))
and (games.homescore<>999 and games.visitorscore<> 999))
order by games.homeid, games.visitorid
But when two teams in the same division ("A" play each
other, I get two results for the one game.
How can I get only the one entry for the game played
between two division opponents?
{Note: games with 999 as score are rainouts}
select distinct games.*, teams.teamname as teamname
from games, teams
where
(((games.homeid=teams.id) or (games.visitorid=teams.id))
and (teams.division="A"
and ((games.homescore is not null) and (games.visitorscore is not null))
and (games.homescore<>999 and games.visitorscore<> 999))
order by games.homeid, games.visitorid
But when two teams in the same division ("A" play each
other, I get two results for the one game.
How can I get only the one entry for the game played
between two division opponents?
{Note: games with 999 as score are rainouts}