Group by clause on 3 tables
From: Jack (jack.witte_at_comcast.net)
Date: 07/31/04
- Next message: Scott: "ReRunning Query"
- Previous message: Tom Ellison: "Re: Your advice for Many to many relain.."
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 31 Jul 2004 19:42:02 GMT
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
- Next message: Scott: "ReRunning Query"
- Previous message: Tom Ellison: "Re: Your advice for Many to many relain.."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|