Gracias por responder te lo pongo aqui
Código MySQL:
Ver original
IFNULL(A.Id
, 'TOTAL') AS ID
, A.nombrem
, A.login
, A.CLAVE
, A.MATERIA
, A.SEMGRUPO
,
COUNT(B.t1
) AS 'TOTAL MAT.', SUM(C.t1
) AS 'CALEND. REGISTRADAS', AVG(IF (C.t1
>= 13, 3, 0)) AS 'CALND. PUNTOS', SUM(D.t1
) AS 'CRITERIOS REGISTRADOS',AVG( IF (D.t1
>= 3, 1, 0)) AS 'CRITERIOS PUNTOS',
/*....... avance programatico P1........*/
E.t1
AS 'cia', AVG( IF(E.t1
>= 1,1,0)) AS 'ciap', F.t1
AS 'ava', AVG( IF(F.t1
= 'TOTAL',1,0)) AS 'avap', AVG(G.t1
) AS 'cafa' , AVG( IF (G.t1
>= 0, 100, 0)) AS 'cafap' , AVG(G.t2
) AS 'asia', AVG(IF(G.t1
>0, 1,0)) AS cafap
, SUM(H.t1
) AS proba
, A. ACADEMIA
, AVG( IF (H.t1
>= 1, 1, 0) ) AS probap
, CONTANDO
ON A.login
=B.login
AND A.CLAVE
=B.CLAVE
(SELECT NAME
, maestroid
, CLAVE
, SEMGRUPO
, ACCESO
, BANDERA
, COUNT(ACCESO
) AS t1
FROM `calendarizacion_maestros` ON A.login
=C.maestroid
AND A.CLAVE
=C.CLAVE
ON A.login
=D.Maestroid
AND A.CLAVE
=D.CLAVE
/*..... apartir de aqui avanceprogramatico parcial 1.....*/
(SELECT login
, SEMGRUPO
, CLAVE
, cimp
AS t1
ON A.login
=E.login
AND A.CLAVE
=E.CLAVE
AND A.SEMGRUPO
=E.SEMGRUPO
(SELECT login
, SEMGRUPO
, CLAVE
, AvcReal01
AS t1
ON A.login
=F.login
AND A.CLAVE
=F.CLAVE
AND A.SEMGRUPO
=F.SEMGRUPO
ON A.login
=G.NUSUARIO
AND A.CLAVE
=G.CLAVE
AND A.SEMGRUPO
=G.SEMGRUPO
ON A.login
=H.maestroid
AND A.CLAVE
=H.CLAVE
AND A.SEMGRUPO
=H.SEMGRUPO
( SELECT ACADEMIA
, login
, SEMGRUPO
, CLAVE
, COUNT(CLAVE
) AS CONTANDO