![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
09/07/2009, 15:29
|
![Avatar de huesos52](http://static.forosdelweb.com/customavatars/avatar287966_22.gif) | Colaborador | | Fecha de Ingreso: febrero-2009 Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 16 años Puntos: 360 | |
Respuesta: Suma categorias sin repetir y por mes Prueba esto:
Código sql:
Ver originalSELECT categorias,SUM(gastos) FROM tabla1 INNER JOIN tabla2 USING(id_categorias) WHERE date_format(fecha,'%Y-%m') = '2009-07' GROUP BY categorias;
No la he probado.
__________________ Without data, You are another person with an opinion.
W. Edwads Deming |