I place my vote with Jim and Rick.  They beat me to it.

~Brad

-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: Thursday, November 16, 2006 9:44 AM
To: CF-Talk
Subject: Re: CALLING ALL SQL EXPERTS, Please help

You need a group by and an aggregate function:

SELECT  DISTINCT    e.createdByUserID,i.itemID, i.title,                
        max(e.datecreated)
FROM    events e
        JOIN v_items i ON e.itemID = i.itemID
WHERE   e.createdbyuserid = 92
GROUP BY        e.createdByUserID, i.itemID, i.title
ORDER BY        e.datecreated desc


Rick


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260667
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to