Ver originalSELECT MAX(tiempotD) as tmaxma, MIN(tiempotD) as tminma, (SEC_TO_TIME(AVG(TIME_TO_SEC(`tiempotD`)))) as tproma FROM (SELECT (SEC_TO_TIME(AVG(TIME_TO_SEC(`tiempo_ent`)))) as tiempotD, `id_franquicia` as Franq FROM for_tie_proc WHERE DATE_FORMAT(fec_med, '%m')=11 GROUP BY `id_franquicia`)for_tie_proc