Group by help

S

Simonglencross

I have the following query and I have been trying for a long time now to use
group by but it doesnt seem to work.

SELECT tblSubscribers.MailingListID, tblSubscriptions.Cattypes
FROM tblSubscribers INNER JOIN tblSubscriptions ON
tblSubscribers.MailingListID = tblSubscriptions.MailingListID
GROUP BY tblSubscribers.MailingListID, tblSubscriptions.Cattypes;

What I would have expected from the above statement would be all entries in
tblsubscribers with the same mailinglist id to be condensed together! is
this correct any ideas why its not working ? is there another way of doing
this?

Thanks Simon
 
M

[MVP] S.Clark

Close, but the answer is

"All entries in tblsubscribers with the same mailinglist id AND CATTYPES to
be condensed together"

Because that is what you have in the GROUP BY. Take the cattypes out, and
then you'll get the id's grouped.
 
Top