Won't this work?

SELECT  showId
FROM            airdates
GROUP BY        showId
ORDER BY        AVG(rating) 

-----Original Message-----
From: Les Mizzell [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 8 November 2005 4:16 p.m.
To: CF-Talk
Subject: Difficult Sort - Theory

Just looking for ideas...

Assume I have a database with TV Miniseries It's a mySQL database.

TABLES
-----
1. SHOWS
    a. showID
    b. showTITLE
2. AIRDATES
    a. showID
    b. airdate
    c. rating

Now, since it's a miniseries, it will have multiple entries in the
AIRDATES table for each night (part 1, 2, 3, blah, blah..). I need to
AVERAGE the rating for all airdates for each specific title, and then
sort on the average.

I've come up with a couple of VERY convoluted ideas, but the operative
word here is convoluted.

How would any of you approach this?


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



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:223553
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to