error en query: SELECT i.IdInstiFin, s.Nombre, i.NOMBREIF, i.C_STATUS, i.logo, i.IdStatusBuro, (SELECT count(edufin_aplica) FROM bef_ifit_edufin WHERE id_institucion = i.IdInstiFin AND edufin_aplica='si' AND IdPeriodo = i.IdPeriodo) AS EduFin, F_CalificacionGeneral(i.IdInstiFin,i.IdPeriodo) AS CalificacionGral, p.Texto, r.CumpleSIPRES, r.CumpleRECA, r.CumpleRECO, r.CumpleREUNE, r.CumpleUNE, r.CumpleIFIT, r.CumpleREDECO, r.CumpleCalificacion, o.IdGrupo FROM buro_Periodo AS p Inner Join bef_InstFin AS i ON p.IdPeridodo = i.IdPeriodo Inner Join bef_Sector AS s ON i.C_SECSHCP = s.idSector Inner Join bef_RegCumplimiento AS r ON r.IdInstFin = i.IdInstiFin AND r.IdPeriodo = i.IdPeriodo Left Join bef_ComportamientoOtros AS o ON i.IdPeriodo = o.IdPeriodo AND i.IdInstiFin = o.IdInstFin WHERE i.IdStatusBuro = 1 AND i.C_SECSHCP = 58 AND i.IdPeriodo = 13?> ORDER BY i.NOMBREIF You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?> ORDER BY i.NOMBREIF' at line 29