I want to use the Top 10 to scan the table and show me the top 10 costs by site, the way the query is now, it just returns the top 10 of all sites. Any suggestions
----------------------CODE---------------------------------
use BI_db
GO
SELECT OBSITE as Site TOP 10 ,OBREPR as Repair Order,SUM(OOTOTA) AS Sublet Cost
FROM DBO.FLOB INNER JOIN
DBO.FLOO ON DBO.FLOB.OBREPR=DBO.FLOO.OOREPR
WHERE OBCUST=' ' AND OBBKYR=2008
GROUP BY OBSITE,OBREPR
ORDER BY SUBLETCOST DESC
----------------------CODE---------------------------------
use BI_db
GO
SELECT OBSITE as Site TOP 10 ,OBREPR as Repair Order,SUM(OOTOTA) AS Sublet Cost
FROM DBO.FLOB INNER JOIN
DBO.FLOO ON DBO.FLOB.OBREPR=DBO.FLOO.OOREPR
WHERE OBCUST=' ' AND OBBKYR=2008
GROUP BY OBSITE,OBREPR
ORDER BY SUBLETCOST DESC