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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sub script out of range 10
Group By 6
A little help 2
Report Group Footer DLookUp 0
Multi Multi Select List boxes 10
Top 3 per group 3
SUM in a UNION query 2
Nested queries 3

Top