SELECT * FROM cat_empleado;
+------------+-----------------+
| idempleado | nombreempleado |
+------------+-----------------+
| 1 | Juan Perez |
| 2 | Pilar Alcantara |
| 3 | Juan Perez |
+------------+-----------------+
SELECT * FROM vendedor;
+----------+-------+------------+
| empleado | monto | fecha |
+----------+-------+------------+
| 1 | 12.5 | 2015-11-09 |
| 1 | 15.2 | 2015-11-09 |
| 1 | 2.3 | 2015-11-08 |
| 2 | 5.1 | 2015-11-07 |
| 2 | 4.9 | 2015-11-09 |
| 3 | 3 | 2015-11-09 |
| 3 | 3 | 2015-11-09 |
+----------+-------+------------+
La consulta que propongo.
SELECT T.idempleado, T.nombreempleado, SUM(P.monto) AS total FROM vendedor AS P, cat_empleado AS T WHERE P.fecha='09/11/2015'
AND P.empleado=T.idempleado
GROUP BY T.idempleado;
+------------+-----------------+-------+
| idempleado | nombreempleado | total |
+------------+-----------------+-------+
| 1 | Juan Perez | 27.7 |
| 2 | Pilar Alcantara | 4.9 |
| 3 | Juan Perez | 6 |
+------------+-----------------+-------+
La consulta que propones.
SELECT T.nombreempleado, SUM(P.monto) AS total
FROM vendedor P JOIN cat_empleado T
ON P.empleado = T.idempleado
WHERE P.fecha = '09/11/2015'
GROUP BY T.nombreempleado ORDER BY total DESC;
+-----------------+-------+
| nombreempleado | total |
+-----------------+-------+
| Juan Perez | 33.7 |
| Pilar Alcantara | 4.9 |
+-----------------+-------+
sigue con el error not group by expression
Qué SMBD usas?