así
Código sql:
Ver originalmysql> SELECT e.id_categoria_gastos,e.fecha,cg.categoria_gastos,SUM(e.gastos) FROM employee e INNER JOIN categoria_gastos cg USING(id_categoria_gastos) GROUP BY e.id_categoria_gastos;
+---------------------+------------+------------------+------------------+
| id_categoria_gastos | fecha | categoria_gastos | SUM(e.gastos) |
+---------------------+------------+------------------+------------------+
| 167 | 2009-06-01 | Esponsor | 410 |
| 170 | 2009-06-01 | Gastos bancarios | 1.19000005722046 |
| 192 | 2009-06-01 | Moviles | 220.589996337891 |
| 217 | 2009-07-02 | Transferencia | 2999 |
+---------------------+------------+------------------+------------------+
4 ROWS IN SET (0.00 sec)
mysql>