Miren estoy tratando de hacer la siguiente consulta.
Que por mes (enero, febrero, marzo , .etc.), se tenga el top 5 de vendedores.
SELECT
MONTH(ORDER1.DATE_ORDER) AS MONTH,
ORDER1.ID_SELLER,
COUNT(ORDER1.ID_ORDER) AS CANTIDAD_VENTAS,
SUM(ORDER1.PRICE) AS TOTAL_VENTAS,
SUM(ORDER1.AMOUNT) AS CANTIDAD_PROD_VENDIDOS
FROM TRANSACCION_ORDER ORDER1
WHERE (YEAR(ORDER1.DATE_ORDER)) = 2020
GROUP BY MONTH,ORDER1.ID_SELLER
ORDER BY MONTH,TOTAL_VENTAS DESC;
Si bien esto me arroja un resultado correcto, no logro dar con que solo me tome el top 5. Si lo hago con el limit me toma los 5 de todos los meses y yo necesito que por el mes de enero me tome el top 5, para febrero me tome su top 5 y asi sucesivamente.
Este es el resultado que arroja.
Desde ya les agradezco la ayuda.
Saludos