Kebabmeister
Programmer
Hi
Don't know if this is the forum for this but I'm writing an Oracle 8 SQL query as below and want to restrict the output to just the top 10 groups. Does anyone know the way?
SELECT LOCATIONS.DESCRIPTION, COUNT(*)
FROM WORKORDER, LOCATIONS
WHERE WORKORDER.LOCATION = LOCATIONS.LOCATION AND WORKORDER.SITEID = LOCATIONS.SITEID AND
WORKORDER.ORGID = LOCATIONS.ORGID AND WORKORDER.SITEID = :mroSite
GROUP BY LOCATIONS.DESCRIPTION
ORDER BY COUNT(*) DESC
Don't know if this is the forum for this but I'm writing an Oracle 8 SQL query as below and want to restrict the output to just the top 10 groups. Does anyone know the way?
SELECT LOCATIONS.DESCRIPTION, COUNT(*)
FROM WORKORDER, LOCATIONS
WHERE WORKORDER.LOCATION = LOCATIONS.LOCATION AND WORKORDER.SITEID = LOCATIONS.SITEID AND
WORKORDER.ORGID = LOCATIONS.ORGID AND WORKORDER.SITEID = :mroSite
GROUP BY LOCATIONS.DESCRIPTION
ORDER BY COUNT(*) DESC