
09/07/2009, 15:29
|
 | Colaborador | | Fecha de Ingreso: febrero-2009 Ubicación: Manizales - Colombia
Mensajes: 5.980
Antigüedad: 16 años, 1 mes 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 |