Sorry...I hate mistakes: That could cut down on confusion. On 11/8/05, John C. Bland II <[EMAIL PROTECTED]> wrote: > > If you have that much data why not create a view for each one then a view > to pull them together? That cut down on confusion. > > On 11/8/05, Les Mizzell < [EMAIL PROTECTED]> wrote: > > > > I'll work with this tomorrow and let you know what happens. In the > > "real" query, there's another 4 tables that data has to be filtered by > > and selected from! It gets pretty wild looking.. > > > > Thanks for taking time to look at this... > > > > > > > Thinking about that some more, the outer select should be unneeded. > > > Just move the ORDER BY to the first subquery and you should be good to > > > go. And add the missing FROM shows clause that I completely forgot. > > > > > > select showId, showTitle ( > > > select avg(rating) > > > from airdates > > > where showId = shows.showId > > > ) as avgRating > > > from shows > > > order by avgRating > > > > > > which, aside from formatting differences, is exactly what John > > > proposed yesterday. Note to self: never try and think code while > > > doing drywall. ;) > > > > > > cheers, > > > barneyb > > > > > > On 11/8/05, Barney Boisvert <[EMAIL PROTECTED]> wrote: > > > > > >>This is untested, but should work: > > >> > > >>select * > > >>from ( > > >> select shows.showId, shows.showTitle, ( > > >> select avg(rating) > > >> from airdates > > >> where showId = shows.showId > > >> ) as avgRating > > >>) t > > >>order by avgRating > > >> > > >>cheers, > > >>barneyb > > >> > > > > > > > > > > > > -- > > > Barney Boisvert > > > [EMAIL PROTECTED] > > > 360.319.6145 > > > http://www.barneyb.com/ > > > > > > Got Gmail? I have 100 invites. > > > > > > > > > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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:223649 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

