|
Posted by David Portas on 09/05/05 15:45
It would be useful to see how you compute the Rank value. Perhaps your
result is possible by adapting your existing query. From what you've
given us, try this:
SELECT T1.item_name, T1.manufacturer, T1.rank
FROM (/* Your query */) AS T1
JOIN (/* Your query */) AS T2
ON T1.manufacturer = T2.manufacturer
AND T1.rank <= T2.rank
GROUP BY T1.item_name, T1.manufacturer, T1.rank
ORDER BY COUNT(*), T1.rank DESC
Just substitute your query or a view that contains it after the FROM
and JOIN.
--
David Portas
SQL Server MVP
--
Navigation:
[Reply to this message]
|