probably a couple ways to do this.. in Oracle I'd use the over
partition by analytic function.
SELECT
   COUNT(groupID) over (partition by groupID) as thisCOUNT,
   emailID,
   emailADDRESS,
   emailDATE,
   groupID
 FROM log_email
 WHERE emailID = <cfqueryparam value="#trim(url.emailID)#"
       cfsqltype="CF_SQL_INTEGER" />
 ORDER BY emailDATE desc

then you dont need the GROUP BY caluse


On Tue, May 5, 2009 at 10:56 AM, Les Mizzell <[email protected]> wrote:
>
> What I'm trying to get:
>
> <cfoutput query="thisLOG" group="groupID" />
>   #thisCOUNT# emails sent on #thisLOG.emailDATE#
>    <cfoutput>
>      #thisLOG.emailADDRESS#<br>
>    </cfoutput>
> </cfoutput>
>
> "thisCOUNT" above would be the number of emails in a particular group
>
>
> Here's what I want to do in my query - but errors work since everything
> isn't included in a scalar function. I'm using SQL Server
>
> SELECT
>    COUNT(groupID) as thisCOUNT,
>    emailID,
>    emailADDRESS,
>    emailDATE,
>    groupID
>  FROM log_email
>  WHERE emailID = <cfqueryparam value="#trim(url.emailID)#"
>        cfsqltype="CF_SQL_INTEGER" />
>  GROUP BY groupID
>  ORDER BY emailDATE desc
>
>
> Haven't found a way to correct this yet that works. Suggestions please?
>
> TIA!
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f

Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322178
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