I removed Having and it worked fine. I just needed to do the group by is
all.
Thanks,
Bruce
On 4/24/07, Peter Boughton <[EMAIL PROTECTED]> wrote:
>
> I can't think of an obvious one, but you can find out which email
> addresses are duplicated like this:
>
> SELECT mem.Email, COUNT(grp.GroupID)
> FROM tblcurrentCouncilMembers mem
> JOIN tblCouncilEmailGroup grp ON (mem.Member_ID = grp.MemberID)
> WHERE grp.GroupID IN (17, 19, 21)
> GROUP BY mem.Email
> HAVING COUNT(grp.GroupID) > 1
>
> (or possibly HAVING is above GROUP BY - I can never remember the order of
> them)
>
> Unfortunately that wont actually tell you which ids the emails belong
> to - you'd need to do a SELECT groupID ... WHERE Email IN ({list of
> duplicated emails}) for that.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW
Archive: http://www.houseoffusion.com/groups/SQL/message.cfm/messageid:2818
Subscription: http://www.houseoffusion.com/groups/SQL/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.6