Matthew Walker wrote:
> Won't this work?
> 
> SELECT        showId
> FROM          airdates
> GROUP BY      showId
> ORDER BY      AVG(rating) 

Hmmm - that's an idea, but doesn't seem to want to work.
Here's the actual query below. (Vastly simplified)


SELECT
  Airdates.rating,
  Airdates.ShowID,
  Shows.Title,
  Shows.ShowID
FROM
  Shows
  INNER JOIN Airdates ON (Shows.ShowID = Airdates.ShowID)
WHERE
   Shows.title like '%#form.show_title#%'
   and Airdates.rating > #form.AMOUNT#
GROUP by Shows.ShowID
ORDER BY Airdates.#form.typeRATE# DESC


It works fine until I try until I try to change the order clause:
ORDER BY AVG(Airdates.rating) DESC

Error: Invalid use of group function

mySQL Database

Other Ideas?

-- 
-----------
Les Mizzell

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223616
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to