Select Top 10 name, product, SumSale
From
(
Select name, product, Sum(sales) As SumSale
From MyTable
Group By product, name
) As D ( name, product, SumSale)
Order By product, SumSale Desc, name
ASKER
Microsoft SQL Server 2005 is a suite of relational database management system (RDBMS) products providing multi-user database access functionality.Component services include integration (SSIS), reporting (SSRS), analysis (SSAS), data quality, master data, T-SQL and performance tuning. It includes support for managing XML data and allows a database server to be exposed over web services using Tabular Data Stream (TDS) packets encapsulated within SOAP (protocol) requests.
TRUSTED BY
ASKER
'dense_rank' is not a recognized function name.
Any way to do in SQL2000?