Just off the top of my head, I believe it is:
select refkeywords, sum(refcount) as trefcount
from referer
group by refkeywords
having sum(refcount) > 5
order by sum(refcount) desc
I haven't tested it but give it a try.
Steve
-----Original Message-----
From: Che Vilnonis [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 9:18 AM
To: CF-Talk
Subject: OT: Another SQL Question...
I know I'm a PITA...but a have another SQL question.
Take the following query:
SELECT RefKeywords, SUM(RefCount) AS TRefCount
FROM Referer
GROUP BY RefKeywords
ORDER BY SUM(RefCount) DESC
How would I write the same query with a WHERE clause
that had a 'SUM(RefCount) > 5' ??? I get an error with
aggregates in a where clause.
Thanks, Che
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]