Do this:
SELECT d.DeptName AS dName,
AVG(a.Amount) AS AverageAward,
SUM(a.Amount) AS DeptTotal
You can't select individual amounts if you're performing aggregates on that
same column.
Also, your SUM(a.Amount) > 5000 belongs probably needs to go in the HAVING
clause.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:320877
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4