Hi.
I am trying to get a list of articles for a "related article" section. I want
to order the list by the "Count" or the number of duplicated rows returned (the
more rows returned, the closer that article is to a match) I have FINALLY
worked out how to get this list, AND count it. But... I can't seem to get the
list to order by rank.
SELECT Count(*) AS Rank, Name, ID FROM
(SELECT Articles.articleID AS ID, Articles.ArticleTitle AS Name
FROM Articles INNER JOIN ArticleActivities ON
Articles.articleID = ArticleActivities.articleID
WHERE ArticleActivities.ActivityID = 6
UNION ALL
SELECT Articles.articleID, Articles.ArticleTitle
FROM Articles INNER JOIN ArticleCategories ON
Articles.articleID = ArticleCategories.articleID
WHERE ArticleCategories.CatChildID = 6
UNION ALL
SELECT Articles.articleID, Articles.ArticleTitle
FROM Articles INNER JOIN ArticleDestinations ON
Articles.articleID = ArticleDestinations.articleID
WHERE ArticleDestinations.destinationID = 6
UNION ALL
SELECT Articles.articleID, Articles.ArticleTitle
FROM Articles
WHERE Articles.CountryID = 2) AS EntireList
GROUP BY Name, ID
ORDER BY Rank
It's the "Order by Rank" bit that is giving me a "too few parameters" error.
The only option I've discovered is to use a QofQ and just select all and
reorder it - but I sense there's something basic I'm missing. Is there a reason
the above won't work?
thanks
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http:http://ad.doubleclick.net/clk;56760587;14748456;a?http://www.adobe.com/products/coldfusion/flex2/?sdid=LVNU
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:267581
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4