This may be something like that you want.
<cfquery name="findDups">
SELECT max(a.email_id) as email_id, a.ml_email
FROM nl_mailgroups a
inner join nl_catREL c on c.email_id = a.email_id
WHERE c.groups_id = <cfqueryparam value="#req.thisGROUPID#"
cfsqltype="CF_SQL_INTEGER"
/>
group by a.ml_email
ORDER BY email_id
</cfquery>
Your other query may be taking a while due to a missing index on the
ml_email column.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:359652
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm