I have a question with the following exercise:
Aware of the extra expenses that employees must face in the month of March, it is desired to reward the employee or employees with the highest sales amount for the month of March. To do this, we want to know the name, surname and total amount of sales made in March of the employees who meet this condition. The information must be shown in the format of the example and ordered in ascending order by salary and last name:
This is the query I have, but I can not get the result of the image above.
SELECT
E.PNOMBRE "NOMBRE",
E.APPATERNO "APELLIDO",
SUM( V.MONTO_TOTAL) "MONTO TOTAL VENTAS"
FROM EMPLEADO E JOIN VENTAS V ON(E.ID_EMPLEADO = V.ID_EMPLEADO)
WHERE(FECHA_BOLETA >='01032014' AND FECHA_BOLETA <='31032014')
GROUP BY E.PNOMBRE, E.APPATERNO;
This is my result:
I appreciate your help because I have tried everything but I can not limit it to only showing me the biggest sale since I still do not understand the use of having
.