SELECT timecontrollings.id,
       timecontrollings.usuario,
       timecontrollings.centroCosto,
       centro_costos.nombre as nombreCentroCosto,
       centro_costos.codigo,
       ROUND(SUM(timecontrollings.horas),2) as horas,
       centro_costos.color,
       MONTH(timecontrollings.fecha) as mes,
       YEAR(timecontrollings.fecha) as year,
       timecontrollings.createdAt,
       timecontrollings.updatedAt
FROM   timecontrollings, centro_costos
WHERE timecontrollings.centroCosto=centro_costos.id
GROUP BY  usuario, centroCosto, MONTH(timecontrollings.fecha), YEAR(timecontrollings.fecha)
