Two Different Kinds of Counting This question reminds me...
Here's a stripped down version of a database...
users
user_id
username
board
user_id
club_id
post
members
user_id
club_id
clubs
club_id
club_name
Now I want to create a recordset that makes summary page for a particular user, by counting up the number of post's in the BOARD table, and the number of user_id's in the MEMBERS table for each club that the user is a member of. So you want:
SELECT count(b.post) AS post_count, and count(m.user_id) AS members_count
FROM board AS b, members AS m
WHERE b.club_id = m.club_id AND b.user_id = ?
GROUP BY club_id
However... this does not give you the correct counts... so how would you write the query to count both? can you? I currently do the count of members in a seperate query within my ASP page, which works, but perhaps uses more resources.