hola eeee select a.matricula,a.nombre,a.ape_pat,a.ape_mat,a.id_alumno,p.plantel, count(k.id_kardex) as total from alumno as a,kardex as k, plantel as p where a.equivalencia='*' and k.id_alumno=a.id_alumno and k.id_periodo= and k.cve_plantel=p.cve_plantel group by a.matricula,a.nombre,a.ape_pat,a.ape_mat,a.id_alumno,p.plantel order by p.plantel,a.ape_pat,a.ape_mat,a.nombre