Group by clause on 3 tables

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

I have 3 tables: Teams(TID,...)
Players(TID,PID,...)(1:M with Teams)
and Games(TID,GID,....)(1:M with Teams)
I am trying to write a group by query on teams and get the number of players
and number of games each team has.
If I write the group by just for each tabell by itself I get the correct
count(14 for players and 10 for games).
If the query contains all three tables linked by TID, I get the count for
games ok(10) but the count for players is (10), the same as the count for
games.
I cant figure out what I have done wrong.

In the query I have Group by clause on TeamID and the count on PID and count
on GID
Thanks for any help
 
Back
Top